Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,689 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,320 people online right now. Registration is fast and FREE... Join Now!




Formatting Decimals

 
Reply to this topicStart new topic

Formatting Decimals

fyrestorm
post 10 Oct, 2002 - 05:08 PM
Post #1


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


ok, so i was doing some adding with php and whatnot, and i need to retain this form: 0.00 but it keeps dropping the extra 0 at the end, anyone have some suggestions on how to keep this?
User is offlineProfile CardPM

Go to the top of the page

skrilla
post 11 Oct, 2002 - 06:05 AM
Post #2


boots.

*****
Joined: 5 Jul, 2002
Posts: 2,848



Dream Kudos: 14
My Contributions


trying to print it out? try this

CODE

<?php
var $decNum = 0.0

echo ($decNum . "0");
?>


if it actually need to be in the code, er, ill do some more research...
User is offlineProfile CardPM

Go to the top of the page

fyrestorm
post 11 Oct, 2002 - 07:57 AM
Post #3


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


well, with that solution, i need to know how to detect how many numbers are after the decimal place...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:36AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month