Results 1 to 5 of 5
Thread: Add Decimal Point
-
01-31-2014, 06:24 AM #1Web Hosting Evangelist
- Join Date
- Aug 2007
- Location
- Oakham England
- Posts
- 503
Add Decimal Point
Hey,
I have the following types of numbers 10000 or 150 and I need PHP to take that and add a . before the last 2 so the above would become.
100.00 and 1.50
Thanks.
DanStreama - Your WordPress Friend
http://www.streama.co.uk
-
01-31-2014, 06:37 AM #2Retired Moderator
- Join Date
- Mar 2003
- Location
- Kathmandu, Nepal
- Posts
- 3,982
number_format($number/100,2);
something like that should do it.Kevin Ohashi - Founder of ReviewSignal.com - Honest Web Hosting Reviews
Check out my 2021 WordPress Hosting Performance Benchmarks, the most comprehensive look at WP hosting performance
-
01-31-2014, 12:50 PM #3Web Hosting Evangelist
- Join Date
- Aug 2007
- Location
- Oakham England
- Posts
- 503
Perfect, Thanks very much for your help!
Streama - Your WordPress Friend
http://www.streama.co.uk
-
02-02-2014, 05:59 AM #4Junior Guru
- Join Date
- Feb 2006
- Posts
- 188
Code:str_pad($number, 2, "0", STR_PAD_RIGHT)
★ Web Hosting by Brontobytes
-
02-02-2014, 06:09 AM #5Retired Moderator
- Join Date
- Mar 2003
- Location
- Kathmandu, Nepal
- Posts
- 3,982
Kevin Ohashi - Founder of ReviewSignal.com - Honest Web Hosting Reviews
Check out my 2021 WordPress Hosting Performance Benchmarks, the most comprehensive look at WP hosting performance
Similar Threads
-
decimal to binary conversions?
By sTag-Dan in forum Web Hosting LoungeReplies: 3Last Post: 02-13-2008, 12:24 PM -
Decimal problems with number_format()
By MGCJerry in forum Programming DiscussionReplies: 4Last Post: 02-06-2004, 02:14 PM -
What does an add-on domain point to?
By vito in forum Hosting Software and Control PanelsReplies: 6Last Post: 02-08-2003, 04:34 PM -
Binary <-> Decimal Conversion
By Icheb in forum Programming DiscussionReplies: 6Last Post: 10-15-2002, 06:02 PM -
Simple PHP Decimal Help
By Mr_Predator in forum Programming DiscussionReplies: 11Last Post: 09-28-2002, 11:33 PM