View Issue Details

IDProjectCategoryView StatusLast Update
0016133mantisbtcustom fieldspublic2017-10-28 19:08
Reporterpolzin Assigned Tovboctor  
Status closedResolutionfixed 
Product Version2.7.0 
Target Version2.8.0Fixed in Version2.8.0 
Summary0016133: Numeric field accepts floats and displays them as numeric

Interestingly, for php floats are numeric. As a consequence, there is no difference between custom fields of type "numeric" and "float". The mantis-docs say, "numeric" means "is an integer", but any numeric value may be accepted.

A correct test for integer-strings is described here:

For "floats" is_numeric() is sufficient, although it allows "4e1" and "0x123". Therefore, a better solution would be valuable here, too.

Workaround: Use a string with regexps. :-/

Additional Information

TagsNo tags attached.


Related Changesets

MantisBT: master bc402539

2017-10-14 14:20:59


Details Diff
Numeric fields shouldn’t accept floats

Fixes 0016133
Affected Issues
mod - core/custom_field_api.php Diff File

Issue History

Date Modified Username Field Change
2013-07-03 14:40 polzin New Issue
2013-07-03 15:34 atrol Status new => confirmed
2017-10-14 14:22 vboctor Assigned To => vboctor
2017-10-14 14:22 vboctor Status confirmed => assigned
2017-10-14 14:22 vboctor Product Version => 2.7.0
2017-10-14 14:22 vboctor Target Version => 2.8.0
2017-10-14 14:22 vboctor Note Added: 0057959
2017-10-22 13:19 vboctor Changeset attached => MantisBT master bc402539
2017-10-22 13:19 vboctor Status assigned => resolved
2017-10-22 13:19 vboctor Resolution open => fixed
2017-10-22 13:19 vboctor Fixed in Version => 2.8.0
2017-10-22 13:33 vboctor Summary Custom fields: No difference between "numeric" and "float" => Numeric field accepts floats and displays them as numeric
2017-10-28 19:08 vboctor Status resolved => closed