Client script for paid amount field to display text

I have a doctype called payment entry in this doctype i have a column called paid amount . i want paid amount column to text .for example paid amount is 1000 in text field display thousand rupees. i need client script.

This is the function to convert the number into word


maybe it helps

i need client script only

possible with server script, not the client script.

Please apply it in the server script doctype. and also check the field name.