Ask, reply and learn. Join the community of Akaunting.
Hello guys,
I am having trouble using JP - Yen. In Japan, you do not use "Precision" or "the Japanese yen doesn't use a minor unit".
Example:
var number = 123456.789;
// the Japanese yen doesn't use a minor unit
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(number));
// expected output: "¥123,457"
Then when editing an Expenses->Payments post, the system deletes the decimal values, for example:
Value ¥1,596
https://prntscr.com/n3dk4y
With the form open(Edit Payments):
The toLocaleString()
method returns a string with a language-sensitive representation of this number:
function eJapan(x){
return x.toLocaleString('ja-JP');
}
console.log(eJapan(123456));
// expected output: "123,456"
console.log(eJapan("123456"));
// expected output: "123456"
console.log(eJapan(NaN));
// expected output: "NaN"
/*CONSOLE LOG RETURN*/
> "123,456" > "123456" > "NaN"
Showing 1 to 2 of 2 discussions