You are here: RE: [PHP] showing the decimal places « PHP « IT news, forums, messages
RE: [PHP] showing the decimal places

Posted by Kim Madsen on 03/17/05 09:28

-----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/language.types.type-juggling.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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация