PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Float value normalization

Floating point values can be parsed with the getFloat($value, array $options = array()) function. A floating point value will be returned.

Example 571. Floating point value normalization

<?php
$locale 
= new Zend_Locale('de_AT');
$number Zend_Locale_Format::getFloat('13.524,678',
                                       array(
'precision' => 2,
                                             
'locale' => $locale)
                                      );

// will return 13524.68
print $number;

Zend Framework