I'm storing the number and currency formats in the default numeral js format. I allow the user to have their own formatting based on their locale setting. I'm trying to figure out how I can convert their custom formatting back to the default formatting in order to store it consistently and in case they change locale.
for example the current is set:
numeral.register('locale', 'fr', {
delimiters: {
thousands: '.',
decimal: ','
},
abbreviations: {
thousand: 'k',
million: 'm',
billion: 'b',
trillion: 't'
},
ordinal : function (number) {
return number === 1 ? 'er' : 'ème';
},
currency: {
symbol: '€'
}
});
When I get '0.0,00€' back as preferred formatting, how can I convert is back to the default numeral.js setting being '0,0.00$' for storage.