Page 1 of 1

Convert Numeric to Words Script

Posted: Tue Oct 18, 2016 11:05 pm
by vssoft
Hi,

How can we convert numeric amount into words which i need to print in Invoices?

Suppose Invoice Amount is Rs.1000 it will convert into words : Rupees One Thousand Only.

Thanks
Vishal

Re: Convert Numeric to Words Script

Posted: Wed Oct 19, 2016 12:38 am
by web-project
you will be able to write the library for conversion of numbers into words, see example:
http://www.karlrixon.co.uk/writing/conv ... -with-php/

Re: Convert Numeric to Words Script

Posted: Wed Oct 19, 2016 12:02 pm
by vssoft
I am a beginner and little knowledge of PHP. I don't know where to place the above code in opencart so that i am able to call this function to convert Numeric into words.

Please explain little bit more.

THanks
Vishal

Re: Convert Numeric to Words Script

Posted: Wed Oct 19, 2016 4:54 pm
by fido-x
Interesting concept!

The script that web-project pointed out could be converted into a "tool" that can be used in OpenCart (done). However, there are limitations on how it could be used.

It couldn't be used to convert a "price", as this has already been formatted with currency symbol, decimal point (which may differ from currency to currency - some use a dot, others use a comma) and possibly a thousand separator (again, this may differ from currency to currency). It would only work on a "raw" number and, if that "raw" number was a decimal like 100.00, you would end up with "one hundred point zero zero" being displayed and not "one hundred".

Would it be possible to provide a "mock-up" of how you want it to look on the invoice?

Re: Convert Numeric to Words Script

Posted: Wed Oct 19, 2016 6:58 pm
by vssoft
I just want to know where i will copy the above code so that i can call and test this function from my invoice.tpl file.

I dont know how the function/procedure works in opencart , where i copy above code to use & test this function otherwise
understand what the output can get from this function.

Thanks
Vishal

Re: Convert Numeric to Words Script

Posted: Wed Oct 19, 2016 7:23 pm
by fido-x
PM sent.