Yes, with toFloat() I get string(5) "99.00", but I wanted to have string(5) "99,00" when using sv_SE locale.
Regards, Saša Stamenković thomasW wrote: > > It's the same reason as for toFloat(). > > But the used number format is different for each of the functions. > toInteger(), toFloat() and toNumber() all define different formats and > therefor they all handle number differently. When this would not be the > case, then there would have been no reason to create 3 methods. :-) > > You could get the same result within toNumber() when you define that the > number format has to be rounded instead of truncated. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > > ----- Original Message ----- > From: "umpirsky" <[email protected]> > To: <[email protected]> > Sent: Wednesday, July 01, 2009 6:18 PM > Subject: Re: [fw-general] Error rounding float value with > Zend_Locale_Format::toNumber() > > >> >> Hm, maybe, but what is precision for in toNumber method then? And why it >> works for most cases and not for this particular one? >> >> Regards, >> Sasa Stamenkovic. >> >> >> thomasW wrote: >>> >>> Shouldn't you use toFloat when you want to have a float value ? >>> >>> Greetings >>> Thomas Weidner, I18N Team Leader, Zend Framework >>> http://www.thomasweidner.com >>> >>> ----- Original Message ----- >>> From: "umpirsky" <[email protected]> >>> To: <[email protected]> >>> Sent: Wednesday, July 01, 2009 4:04 PM >>> Subject: [fw-general] Error rounding float value with >>> Zend_Locale_Format::toNumber() >>> >>> >>>> >>>> Hi. >>>> >>>> I tried to round 98.99999625 value with Zend_Locale_Format::toNumber() >>>> and >>>> I >>>> get result 98, I expected 99.00. >>>> >>>> I've just added new issue >>>> http://framework.zend.com/issues/browse/ZF-7170. >>>> Do you think I'm wrong somewhere in my code? >>>> >>>> Regards, >>>> Sasa Stamenkovic. >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/Error-rounding-float-value-with-Zend_Locale_Format%3A%3AtoNumber%28%29-tp24290360p24290360.html >>>> Sent from the Zend Framework mailing list archive at Nabble.com. >>> >>> >>> >> >> -- >> View this message in context: >> http://www.nabble.com/Error-rounding-float-value-with-Zend_Locale_Format%3A%3AtoNumber%28%29-tp24290360p24292705.html >> Sent from the Zend Framework mailing list archive at Nabble.com. > > > -- View this message in context: http://www.nabble.com/Error-rounding-float-value-with-Zend_Locale_Format%3A%3AtoNumber%28%29-tp24290360p24302050.html Sent from the Zend Framework mailing list archive at Nabble.com.
