javascript - How can show a number in a format translation? -
javascript - How can show a number in a format translation? -
hello did utilize jquery traslate numbers words.
here view , demo: here
<form> number words<br> <br>number/número <input name="number" type="number" size="60" value="123"> <br><textarea name="spanish" rows="5" cols="90"></textarea><br> </form>
and show:
ciento veintitres con /100 nuevos soles
but want show (when has no point symbol)
ciento veintitres con 00/100 nuevos soles
the other problem symbol point not working correctly, illustration in line:
<input name="number" type="number" size="60" value="123.12"> <br>
i should have
ciento veintitres con 12/100 nuevos soles
i tried here
can point out i've done wrong?
you can start @ top of sec function splitting
number @ decimal, if there's one, next code:
var cents = s.split('.')[1] || '00', s = s.split('.')[0] || s;
then alter number
in line pointed out @halcyon cents
(line 143):
homecoming (result+" con "+ cents +"/100 nuevos soles");
working demo
javascript jquery html
Comments
Post a Comment