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&uacute;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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -