Re: integer to string

From: Date: Thu, 15 May 2003 21:19:06 +0000
Subject: Re: integer to string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-147814@lists.php.net to get a copy of this message
$v = number_format($v,1); On Thu, 2003-05-15 at 10:27, Brian V Bonini wrote: > I have this: > > for($i = 1; $1 <= 2.1; $i += 0.1) { > $p_val[] = $i; > } > > foreach($p_val as $v) { > echo $v . "\n"; > } > > which returns: > > 1 > 1.1 > 1.2 > 1.3 > 1.4 > 1.5 > 1.6 > 1.7 > 1.8 > 1.9 > 2 > > how to I get it so that 1 & 2 are 1.0 & 2.0 > > ?? > > Thanks! -- Adam Voigt (adam@cryptocomm.com) Linux/Unix Network Administrator The Cryptocomm Group

« previous php.general (#147814) next »