PhpRiot
Follow phpriot on Twitter
Sponsored Link
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
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

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 554. 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