Open Tirodem opened 5 days ago
We already have FRACTION_DIGITS_PER_CURRENCY
export const FRACTION_DIGITS_PER_CURRENCY = Object.freeze({
BTC: 8,
CHF: 2,
EUR: 2,
USD: 2,
ZAR: 2,
XOF: 2,
XAF: 2,
CDF: 2,
SAT: 0
}) satisfies Record<Currency, number>;
It's something that needs to be edited when adding a new currency anyway.
We can base ourself on this for the number of digits
Sure it's a super good base to work on. We just need to avoid situations where we displayed that something cost 2.1200000000 BTC if price is 2.12 only (rare case I admin due to conversion rate and BTC amount, but on BTC as price reference currency store it can become a problem).
Current use (in FR & CH) is to display "5.90" instead of "5.9". But some countries would rather "5.9" instead of "5.90". We need to create a setting in /admin/config to allow the be-BOP owner to do as he/she wants. Plus, we need to study if there's countries with 0 or 3 decimals on their currencies.