#2345 - Allow decimal place specification for float fields

Identifier #2345
Issue type Feature request or suggestion
Title Allow decimal place specification for float fields
Status Completed
Handling member Chris Graham
Addon core_fields
Description float.php has this code:
$ev = float_format(floatval($ev));

It would be nice if field options could be used to determine what exact parameters are used with our float_format function.

This is important for price fields, as those must have exactly 2dp or 0dp. You can't reasonably just use a short_text field for a price field, because user's may put in nonsense and also sorting will break.

Come to think of it, we probably need a flag to have price display logic, so it shows 0dp if there's no decimal component, or 2dp if there is.
Steps to reproduce

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated