RE: [PHP] showing the decimal places

This is a discussion on RE: [PHP] showing the decimal places within the PHP General forums, part of the PHP Programming Forums category; -----Original Message----- From: ross@aztechost.com [mailto:ross@aztechost.com] Sent: Thursday, March 17, 2005 1:21 AM > when ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-17-2005
Kim Madsen
 
Posts: n/a
Default RE: [PHP] showing the decimal places

-----Original Message-----
From: ross@aztechost.com [mailto:ross@aztechost.com]
Sent: Thursday, March 17, 2005 1:21 AM

> when I define a number as


> $number = 2.00


> then echo it the number shows as 2. How can I get the two zeros to

show?

Are You _sure_ the var is declared as a float? Have a look at gettype()
http://dk2.php.net/manual/en/function.gettype.php

$number += 2.00;

Should convert the var to a float according to:
http://dk2.php.net/manual/en/languag...php#language.t
ypes.typecasting



--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler
Naverland 31

DK-2600 Glostrup
www.comx.dk
Telefon: +45 70 25 74 74
Telefax: +45 70 25 73 74
E-mail: km@comx.dk
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0