Answer the question
In order to leave comments, you need to log in
How to display numbers after a dot in a smaller font?
Numbers come from the backend in this format 1234566.000910923
How can I display on the page so that the characters after the dot are in a smaller font size (just split and put in a span?)? And another question is, if the number is integer, then display 2 zeros after the dot, and if there are more than 10 characters after the dot, then cut to 10, how to do this? Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Just break it up and put it in a span (or another tag, for example, there is a small tag).
let [ int, frac ] = number.toFixed(2).split('.'); // 10 -> '10', '00'; 12.345 → '12', '35'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question