Currency localization example
// Node.JS implemented this with ICU: http://userguide.icu-project.org/i18n
// There are a lot of implementation of this in a lot of other platforms too.
console.log(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(100000));
console.log(new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', notation: 'compact' }).format(100000));
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(100000));
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY', notation: 'compact' }).format(100000));
console.log(new Intl.NumberFormat('zh-TW', { style: 'currency', currency: 'TWD' }).format(100000));
console.log(new Intl.NumberFormat('zh-TW', { style: 'currency', currency: 'TWD', notation: 'compact' }).format(100000));
no comments