spec/js/numbers/currency.spec.js in twitter_cldr_js-2.3.0 vs spec/js/numbers/currency.spec.js in twitter_cldr_js-2.3.1
- old
+ new
@@ -33,9 +33,13 @@
it("should use given precision if it's specified explicitly", function() {
expect(formatter.format(12.345, {currency: "JPY", precision: 1})).toEqual("¥12.3");
});
+ it("should allow a precision of zero", function() {
+ expect(formatter.format(12.3, {currency: "EUR", precision: 0})).toEqual("€12");
+ });
+
it("should use the cldr_symbol for the corresponding currency code if use_cldr_code is specified", function() {
TwitterCldr.Currencies.currencies = {
"JPY": {symbol: "¥", cldr_symbol: "YEN", currency: "JPY", "name": "Japanese yen"}
};
expect(formatter.format(12, {currency: "JPY", use_cldr_symbol: true})).toEqual("YEN12");
\ No newline at end of file