I have this number 4030.146852312
i need to get the four decimals from this percentage of this number so at the end i get
4030.1468
and transform this number according to locale
so for example
4.030,1468
how can I do this ?
I have this number 4030.146852312
i need to get the four decimals from this percentage of this number so at the end i get
4030.1468
and transform this number according to locale
so for example
4.030,1468
how can I do this ?
You can easly use Intl.NumberFormat
object:
const number = 4030.1468;
console.log(new Intl.NumberFormat('de-DE', { minimumFractionDigits: 4, maximumFractionDigits: 4 }).format(number));
For more info https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat