You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Swiss franc doesn't have an official symbol like the dollar or euro do, and therefore DreamBerd can't be fully used in Switzerland. This issue is of special importance, as the Swiss franc is, according to Wikipedia, the 8th most traded currency, and the first on the list without a symbol.
Because it doesn't have a symbol, it's usually written using the ISO 4217 currency code: 12.35 CHF (CHF is sometimes also written before the value), or if it's in a context where the currency can be assumed (such as a physical store), one of these conventions is used depending on value:
value below 1: -.95
integer value: 399.-
any other value, sometimes also used instead of the above formats: 12.34
We also can't fully agree on the decimal separator; some places use a dot, others use a comma.
Because of this, and because it likely also applies in other countries, I suggest the following syntax for string interpolation be added:
const const name = "world"!
print("Hello {name} CHF!")! // any ISO 4217 alphabetic currency code should work, whether numeric codes (such as 756 for CHF) should work is up for debate
print("Hello CHF {name}!")!
print("Hello {name}.-!")!
print("Hello -.{name}!")!
print("Hello {name}.{name}!")! // if the variable names differ, it should throw a syntax error
Each of these should print the string Hello world!.
Additionally, because smallest coin for the Swiss franc is worth 0.05 CHF, I'd suggest rounding the value to a multiple of 0.05 if the value is a float. Because I doubt we could agree on whether to round away from 0, towards 0, or to the nearest multiple, I suggest a compromise where we round left instead (what that means is up for debate).
The Swiss franc doesn't have an official symbol like the dollar or euro do, and therefore DreamBerd can't be fully used in Switzerland. This issue is of special importance, as the Swiss franc is, according to Wikipedia, the 8th most traded currency, and the first on the list without a symbol.
Because it doesn't have a symbol, it's usually written using the ISO 4217 currency code:
12.35 CHF
(CHF is sometimes also written before the value), or if it's in a context where the currency can be assumed (such as a physical store), one of these conventions is used depending on value:-.95
399.-
12.34
We also can't fully agree on the decimal separator; some places use a dot, others use a comma.
Because of this, and because it likely also applies in other countries, I suggest the following syntax for string interpolation be added:
Each of these should print the string
Hello world!
.Additionally, because smallest coin for the Swiss franc is worth 0.05 CHF, I'd suggest rounding the value to a multiple of 0.05 if the value is a float. Because I doubt we could agree on whether to round away from 0, towards 0, or to the nearest multiple, I suggest a compromise where we round left instead (what that means is up for debate).
For the implementation in #74, the full, up-to-date list of ISO 4217 currencies can be found at https://www.six-group.com/en/products-services/financial-information/data-standards.html, in both Excel and XML formats.
The text was updated successfully, but these errors were encountered: