Open firedev opened 8 years ago
Hey @firedev. Were you able to find a solution? Running into something similar now
+1 here. I had to handle 0 to avoid formatting it with this library. I think the solution is pretty easy though, but maintainers don't seem to accept PRs anymore.
Hey @in15, sorry, I just handle zeros manually.
Sorry to resurect old thread but I've just ran into this issue. After reviewing the code it appears that zero needs its own special format to avoid this issue.
accounting.settings = {
currency: {
symbol : "€", // default currency symbol is '$'
format: {
pos : "%v %s",
zero : "%v %s"
}, // controls output: %s = symbol, %v = value/number (can be object: see below)
decimal : ",", // decimal point separator
thousand: " ", // thousands separator
precision : 2, // decimal places
},
number: {
precision : 0, // default precision on numbers is 0
thousand: " ",
decimal : ","
}
};
please note the zero : "%v %s"
index under format.
This solved this issue at least in my specific case.
Expected:
Actual:
Works if the value is not
0