On 30-Sep-08, at 4:14 AM, LehrerOffice - Jürg Räss wrote:
We've increased the precision to 15 significant digits to maintain
compatibility with Visual Basic, as they also display up to 15
digits of
precision when using Str. Sorry that this was not documented
anywhere, but
we'll definitely update our docs to reflect this change.
@William, thank you for the explanation.
We appreciate if these kind of (significant) changes are documented
in a release... then we wouldn't need to find out only when we notice
a different behavior and could find the required changes more quickly.
@Norman
If you care about how a value is presented you should use format,
not STR.
Even if we care about the format in the described case, we can't use
'Format'... that's because: "Format will use the information based
on the
user's locale"
So depending on the OS set up for Switzerland, Germany, Austria, ...
the
reference-files would contain 1,234.45 / 1'234.45 / 1'234,45 ;-)
For us, 'Format' is the way for information shown to the user, but not
for the way it is saved (in a [text]file) for cross-country purpose.
Fortunately we already wrote a Method which does the formatting, so
we only needed to change the Str() to something else (which is a bit
more complicated now)
You can still use format
1) use format with a number like 1234.5 and find the thousands and
decimal separator
dim thousands as string
dim decimal as string
dim tmp as string = format(1234.5, "0,000.0")
thousands = mid(tmp,2,1)
decimal = mid(tmp,6,1)
2) format the number with the precision you want
tmp = format(number,",#.0000000") // exactly 7 digits after
the decimal
3) do a replace on the value so you can control precisely which
numeric separators are used
you have to be careful to do it in a way that you wont mess the
number up though
tmp = replaceAll(tmp,thousands,chrb(1))
tmp = replaceAll(tmp,decimal, chrb(2))
tmp = replaceAll(tmp,chrb(1),",")
tmp = replaceAll(tmp,chrb(2),".")
or something along those lines
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|