ilikephp Posted August 21, 2010 Share Posted August 21, 2010 Hello, I need to create a receipt using php/SQL: I know how to do it but I have a question plz: ... Name: ______________ Amount: ______________ Signature: _____________ If I put the amount: $200 how can it be typed Two Hundred or if I type: $150 can It be typed One hundred fifty? Thanks a lot... Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 21, 2010 Share Posted August 21, 2010 There are countless php scripts posted all over the Internet that do this. Did you try searching for "php convert numbers to words"? Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/#findComment-1102090 Share on other sites More sharing options...
ilikephp Posted August 21, 2010 Author Share Posted August 21, 2010 Thanks for your help! I got the script from this website http://bloople.net/num2text/ but how can I add a text field so the number will be typed in it and then I press convert to be converted into text. Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/#findComment-1102096 Share on other sites More sharing options...
PFMaBiSmAd Posted August 21, 2010 Share Posted August 21, 2010 Exactly what part of doing this trivial task do you need help with? There are countless examples of forms and php form processing code posted all over the Internet. Taking any of them and adding one line of code to call a php function to convert the entered number into the equivalent word string and output that is, well, a trivial task. Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/#findComment-1102109 Share on other sites More sharing options...
ilikephp Posted August 22, 2010 Author Share Posted August 22, 2010 I am finding a big difficulty in converting numbers (in a text box) to words :S Any help plz or is there a tutorial? Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/#findComment-1102379 Share on other sites More sharing options...
jcbones Posted August 22, 2010 Share Posted August 22, 2010 Copy and paste the function above to your page. Then run your number through it. echo convertNumber($_POST['number']); Quote Link to comment https://forums.phpfreaks.com/topic/211369-creating-a-receipt-form-converting-numbers/#findComment-1102501 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.