[TYPO3-core] RFC: Bug 4689: Error while entering a numbers like 50 or 50.00 into a double2 field

Wolfgang Klinger wolfgang at stufenlos.net
Mon Jan 29 22:44:59 CET 2007


*hiya!*

Michael Stucki wrote:
> Problem:
> Input fields with type "double2" should be converted into a floating field 
> with 2 decimal points. However, the value in the database (e.g. 50.00) will 
> be converted into "50" upon save. Consequently, the comparison of TCEmain 
> will fail, and an error is returned.
> 
> Solution:
> Wrap the value with floatval() so that 50.00 returns 50, but 50.33 still 
> works.
> 
> Bugtracker reference:
> http://bugs.typo3.org/view.php?id=4689
> 
> Branches:
> TYPO3_4-0 & Trunk

floatval depends on PHP 4 >= 4.2.0,
so you may consider typecasting instead
$something = (float)$something;
(though requirement for 4.1 is PHP 4.3)

However, +1


bye
Wolfgang


More information about the TYPO3-team-core mailing list