number.toLocaleString() is not working in react-native, can anyone suggest better way to format currency in react-native,
code goes here
formatMoney(number) {
if(number===undefined||number===null)
{
return 0
}
else
{
var n=number.toString
var obj={
style:'currency',
currency:'GBP'
}
'use strict'
return n.toLocaleString('en-GB', { style: 'currency', currency: 'GBP' });
}
}