I tried this, but it seems not to affect numbers that have less than two decimals, it simply rounds them up
I need something to ouptut to two decimal places even it the number does not contain them
Search found 5 matches
- Thu Apr 03, 2008 4:44 pm
- Forum: PHP - Code
- Topic: Trying to create a percentage from two variables
- Replies: 7
- Views: 230
- Thu Apr 03, 2008 4:36 pm
- Forum: PHP - Code
- Topic: Trying to create a percentage from two variables
- Replies: 7
- Views: 230
Re: Trying to create a percentage from two variables
number_format() If you want to find out how to use it look in the manual. Thanks - I have looked, and in my limited knowledge of the subject, I don't think that is where the problem is. the number_format() seems to be working correctly, as in the number coming back has a maximum of two decimal plac...
- Thu Apr 03, 2008 1:29 pm
- Forum: PHP - Code
- Topic: Trying to create a percentage from two variables
- Replies: 7
- Views: 230
Re: Trying to create a percentage from two variables
It works! Thanks very much indeed for your assistance! I only yhave one hurdle to climb now, can you help me find a way to force the end result to two decimal places? For example, if a discount leaves a result of 6.8 I need it to read 6.80 (currency style). Any thoughts? I looked around the forums, ...
- Thu Apr 03, 2008 5:23 am
- Forum: PHP - Code
- Topic: Trying to create a percentage from two variables
- Replies: 7
- Views: 230
Re: Trying to create a percentage from two variables
Thanks for such a quick reply, I will try it out and let you know.
Thanks fo ryour help, I really appreciate it!
Thanks fo ryour help, I really appreciate it!
- Thu Apr 03, 2008 4:58 am
- Forum: PHP - Code
- Topic: Trying to create a percentage from two variables
- Replies: 7
- Views: 230
Trying to create a percentage from two variables
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too. This is probably so easy to do, but I have been trying for two day...