contao/test — Issue #1152: RGXP for decimal/float/currency
Author: importer
Created: 2011-11-29 07:26:02+00:00
State: open
Labels: Accepted, Feature, framework

Hi Leo,
I'd like to request a new rgxp for decimal/float datatype.
For example, - If a decimal(6,3) is needed for a taxrate or (7,2) for a currency value and is stored using the 'File' Datacontainer, using 'rgxp'=>'digit' and 'maxlength'=>9 will allow a value of 2888.8888 to be stored...which is invalid for both.
This would be extremely useful to allow calculations in general to be performed - especially on currency,taxes etc.

I imagine something that examines the input of 'rgxp'=>'decimal(7,2)' (the same format Mysql uses) and checks for a max character length of 7, a seperator of '.', no more than 2 characters after the '.', only one '.', and characters must only be digits or '.'

Although to complicate things, I understand Europeans like to use ',' as the decimal point????

Cheers, Murray.

--- _Originally created by ramjet on November 11th, 2009, at 04:04am (ID 1152)_