Jump to content
  • 0

VectorScript: decimal separator from System settings


Petri

Question

Both VS and record formats ignore the System level decimal separator definition.

The decimal separator is mathematically a radix point.

[snip]

The choice of symbol for the decimal separator affects the choice of symbol for the thousands separator. Consequently the latter is treated in this article as well.Countries where a comma is used to mark the radix point include:

Albania, Andorra, Argentina, Austria, Azerbaijan, Belarus, Belgium, Bolivia, Bosnia and Herzegovina, Brazil, Bulgaria, Cameroon, Canada (French-speaking), Costa Rica, Croatia, Cuba, Chile, Colombia, Cyprus, Czech Republic, Denmark, Dominican Republic, Ecuador, El Salvador, Estonia, Faroes, Finland, France, Germany, Greece, Greenland, Guatemala, Honduras, Hungary, Indonesia, Iceland, Italy, Latvia, Lithuania, Luxembourg (uses both separators officially), Macedonia, Moldova, Netherlands, Norway, Nicaragua, Panama, Paraguay, Poland, Portugal, Romania, Russia, Serbia, Slovakia, South Africa (officially, but dot point is commonly used in business and science), Slovenia, Spain, Sweden, Switzerland, Turkey, Ukraine, Uruguay, Venezuela, Vietnam. (http://en.wikipedia.org/wiki/Decimal_separator)

Plenty of unhappy people, including a user of mine...

Surely this is easy to fix?

Link to comment

2 answers to this question

Recommended Posts

  • 0

Just figured this out as a way to determine the decimal separator if you need to work across multiple languages/regions.

Tested on Mac OSX 10.9. Not tested on Windows or any other operating systems.

Procedure Test;

var	S1:String;

Function DecimalSeparator: String;
Begin
	If Len(Substring(Num2Str(4,22/7),'.',1))=1 then DecimalSeparator:='.' else DecimalSeparator:=',';
End;

Begin
Message(DecimalSeparator);
End;

Run(Test);

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...