The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> PHP decimals
CodeKing
post Oct 26 2006, 05:56 PM
Post #1


Advanced Member
****

Group: Members
Posts: 175
Joined: 12-September 06
Member No.: 118



I know there's a PHP function that can shorten a decimal to a certain amount of digits. What is it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 26 2006, 06:40 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



You mean round? There should be several, e.g. round().
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CodeKing
post Oct 27 2006, 06:17 PM
Post #3


Advanced Member
****

Group: Members
Posts: 175
Joined: 12-September 06
Member No.: 118



QUOTE(Christian J @ Oct 26 2006, 06:40 PM) *
You mean round? There should be several, e.g. round().


round(50,2) returns 50. Can I get it to return 50.00?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 27 2006, 11:15 PM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(CodeKing @ Oct 28 2006, 08:17 AM) *

QUOTE(Christian J @ Oct 26 2006, 06:40 PM) *
You mean round? There should be several, e.g. round().


round(50,2) returns 50. Can I get it to return 50.00?


Learn to use the C string formatting functions - see:

http://jp.php.net/manual/en/function.sprintf.php

All your problems will then be little ones. sleep.gif blush.gif mad.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 03:52 PM