How to implement the correct count?

when, instead of 150.00
write 1 150, 00 with a space
that is incorrect counting

23 line for example
------------------------
+ in the second case
where 300, 44
believes no fractions why

https://jsfiddle.net/xsyLroe8/
April 19th 20 at 12:24
1 answer
April 19th 20 at 12:26
take not treated of the numbers, such as data-* , and then they render
<p class="basket__single" data-val="300.44"><span>300, 44</span> UAH</p>
@Alex_Willms, do not quite understand

how will this help? I after the recalculation needs to be changed - monique_Considi commented on April 19th 20 at 12:29
here it seems the answer is on the surface, you need to put bare numbers in data-* , and then they get to stay with them for mathematical operations and display to the user in the style of your idea.

Format numbers can be so

// In Russia as a separator whole and a fractional part a comma, and the thousands separator is the space
console.log(number.toLocaleString('EN-us'));
// → 123 456,789
- Alex_Willms commented on April 19th 20 at 12:32

Find more questions by tags jQueryJavaScript