Re: [SMARTY] problem displaying float

From: Date: Fri, 17 Nov 2006 12:49:47 +0000
Subject: Re: [SMARTY] problem displaying float
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13568@lists.php.net to get a copy of this message
George Pitcher wrote: > The following code: > > $fee = 160.44; > $fee2 = $fee + 0; // I have a reason for adding zero; > echo $fee."<br>"; > echo $fee2."<br>"; > settype($fee, "float"); > echo gettype($fee); > I'd be more interested to know what gettype shows before the settype, and also for gettype($fee2). > [...] > and > > 160.44 > 160 > NULL > > when echo'd on a page using a Smarty template. > What does your Smarty template look like? Where are you doing the "maths" (the +0 bit) - within the template? I'm really not clear what you're assigning to the template, or how you're showing it. -- Mark Rogers More Solutions Ltd :: 0845 45 89 555

« previous php.smarty.general (#13568) next »