Page 2 of 2

Re: Comma's in numbers.

Posted: Mon Sep 16, 2013 5:34 pm
by Korolev Michael
Digit group mark must be acquired from system settings. Think, PB team doesn't wish to implement this because this is real headache.

Re: Comma's in numbers.

Posted: Mon Sep 16, 2013 5:50 pm
by Little John
Korolev Michael wrote:Digit group mark must be acquired from system settings.
No, certainly not.
PB code must be exactly the same for all PB users in all countries.

Re: Comma's in numbers.

Posted: Mon Sep 16, 2013 5:59 pm
by skywalk
Ha! I never knew Macro x(a=,b=) was valid :shock:
Since calling it does not allow empty parameters...
x(,2) fails. :(

Re: Comma's in numbers.

Posted: Mon Sep 16, 2013 6:02 pm
by Korolev Michael
Are we regarding comma as a part of code? Or as additional info tip?

Re: Comma's in numbers.

Posted: Mon Sep 16, 2013 7:21 pm
by Little John
Danilo wrote:
freak wrote:Just use a macro:

Code: Select all

Macro Num(a=,b=,c=,d=,e=,f=)
  a#b#c#d#e#f
EndMacro


Debug Num(1,000)
Debug Num(1,000,000)
Nice idea, if you want to use comma ',' as thousands separator (english notation).
I certainly do not want to write e.g.

Code: Select all

x = Num(53,214,589) * Num(45,212,547)
And using commas is not a good idea anyway, for the reasons that have been mentioned at the beginning of this thread.
For those reasons, the space is recommended as digit group separator in the SI/ISO 31-0 standard.
And
Wikipedia (see link above) wrote:Other style-defining bodies are also moving toward this clearer notation. For example, the International Union of Pure and Applied Chemistry (IUPAC) suggest never using a comma or a point as thousands separator: "For numbers with many digits, the digits may be separated in groups of three, counting from the decimal sign toward the left and the right. The groups should be separated by a thin space (half space), and never by a comma or a point, or by any other means."[14] The American Medical Association, whose AMA Manual of Style is widely followed in health professions literature, also endorses a space for the digit group separator.[11] (Specifically, a thin space is endorsed for typesetting; a regular word space is sufficient wherever typographical nicety is impractical.) The United Kingdom Metrication Board also proposed this system for Metrication in the United Kingdom and, while not universally adopted, it is the standard in the UK construction industry.
Since in programming languages (as well as with command-line arguments etc.) spaces mostly are used as separators, it's an old and well established practice to use the underscore '_'. where no separator is intended, but where it shall look almost like a space. Underscores can already be part of identifiers in PB, so why couldn't they be part of numbers? :-)

Re: Comma's in numbers.

Posted: Fri Sep 20, 2013 9:29 pm
by Seymour Clufley
I just want to point out that, in the thread title, "comma's" should not have an apostrophe. The plural of "comma" is "commas".