adamwdraper / Numeral-js

A javascript library for formatting and manipulating numbers.
http://numeraljs.com
MIT License
9.66k stars 925 forks source link

changing decimal point delimiter using numeraljs #631

Open siddushar opened 6 years ago

siddushar commented 6 years ago

This is my configuration. where i have option in my web-app to switch between English and Deutsch. numeral.register('locale', 'de', { delimiters: { thousands: '', decimal: ',' }, abbreviations: { thousand: 'k', million: 'm', billion: 'b', trillion: 't' }, ordinal : function (number) { return '.' }, currency: { symbol: '€' } })

"value_in_per" = "0,9525" now i wantto change this "0,9525" to English locale "0.9525" using numeral JS.. how can i change using numeral JS

dburucu commented 5 years ago

load numeral.min.js load/write your numeral.register ...

numeral.locale('de'); var value_in_per = "0,9525"; numeral(value_in_per).format('0,0.0000');