Open Siskin-Bot opened 4 years ago
Currency component is already implemented in Red language.
It has fixed list with 170 currency ids system/locale/currencies/list
:
[AED AFN ALL AMD ANG AOA ARS AUD AWG AZN
BAM BBD BDT BTC BGN BHD BIF BMD BND BOB
BRL BSD BTN BWP BYN BZD CAD CDF CHF CKD
CLP CNY COP CRC CUC CUP CVE CZK DJF DKK
DOP DZD EGP ERN ETB ETH EUR FJD FKP FOK
GBP GEL GGP GHS GIP GMD GNF GTQ GYD HKD
HNL HRK HTG HUF IDR ILS IMP INR IQD IRR
ISK JEP JMD JOD JPY KES KGS KHR KID KMF
KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL
LYD MAD MDL MGA MKD MMK MNT MOP MRU MUR
MVR MWK MXN MYR MZN NAD NGN NIO NOK NPR
NZD OMR PAB PEN PGK PHP PKR PLN PND PRB
PYG QAR RED RON RSD RUB RWF SAR SBD SCR
SDG SEK SGD SHP SLL SLS SOS SRD SSP STN
SYP SZL THB TJS TMT TND TOP TRY TTD TVD
TWD TZS UAH UGX USD UYU UZS VES VND VUV
WST CFA XAF XCD XOF CFP XPF YER ZAR ZMW]
It does not allow custom currencies:
>> CZK$1
== CZK$1.00
>> XXX$1
*** Syntax Error: (line 1) invalid money at XXX$1
*** Where: case
*** Stack: load
It does not allow math with not same currencies:
>> add USD$100 NZD$100
*** Script Error: USD$100.00 not same denomination as NZD$100.00
*** Where: add
*** Stack:
It allows integer with money math:
>> 10 + USD$100
== USD$110.00
>> 10 * USD$100
== USD$1000.00
Submitted by: Geomol
Imported from: CureCode [ Version: alpha 31 Type: Bug Platform: All Category: n/a Reproduce: Always Fixed-in:none ] Imported from: https://github.com/rebol/rebol-issues/issues/250
Comments:
Submitted by: admin
For R2 doc, http://www.rebol.com/docs/core23/rebolcore-16.html#section-3.4
Submitted by: BrianH
Money currently doesn't support currency designators in R3, so I can't run the example code. If the currency designator syntax was removed intentionally, there is no reason for FIRST to work.
Submitted by: Carl
See this note: http://www.rebol.net/r3blogs/0201.html