Development

#4521 (Bug in sfNumberFormat when handling large numbers)

You must first sign up to be able to contribute.

Ticket #4521 (closed defect: fixed)

Opened 9 months ago

Last modified 9 months ago

Bug in sfNumberFormat when handling large numbers

Reported by: paul Assigned to: fabien
Priority: minor Milestone: 1.1.5
Component: i18n Version: 1.1.2
Keywords: Cc:
Qualification: Unreviewed

Description

Line 174 of sfNumberFormat.class.php reads:

$string = (string) round(floatval($string), $decimalDigits);

There's a chance a float can be returned here, and when converted to a string it will simply show the first digit. I've added intval() to the line here:

$string = (string) intval(round(floatval($string), $decimalDigits));

Example: I was passing 14000000, the result of round() and floatval() was 1.4E+7 which converted to a string read 1.

Change History

09/29/08 15:32:18 changed by paul

  • version changed from 1.0.18 to 1.1.2.

10/05/08 18:52:33 changed by fabien

  • milestone set to 1.1.5.

10/05/08 18:53:02 changed by FabianLange

  • status changed from new to closed.
  • resolution set to fixed.

fixed in r11958

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.