[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Formattedfield floating point precision and scale  XML
Forum Index -> Development
Author Message
mbreyer

Power User

Joined: 02/07/2013 16:08:31
Messages: 42
Location: Cologne
Offline

Hi,

I want the user to input an floating point value with a precison of 12 and a scale of 2.
So it should only be possible to enter 10 digits pre the decimal point.

I try to realize this with a formattedfield, so I set format=double and
formatmask=dec2 like in the demoworkspace. Now the input is rounded after 2 digits past decimal point thats fine. But I don't see any chance to limit the digits pre decimal point.

I tried with a maxlength of 12, but then it's possible to enter 12 digits pre decimal point, and there is no space left to add the zeros past decimal point. I would need the field to reserve two spaces past the decimal point, but its good that the thousands separators and the decimal point aren't counted.

Is there any way to realize this with a formattedField or any other control?

kind regards,
Mario


krinninger

Power User

Joined: 17/11/2008 21:19:41
Messages: 567
Offline

we had the same issue:
see http://www.captaincasademo.com/forum/posts/list/1265.page

we would also appreciate a better support for this one, but the workaround with a regular expression works quite ok.

Greetings,
Michael
mbreyer

Power User

Joined: 02/07/2013 16:08:31
Messages: 42
Location: Cologne
Offline

The solution with a regular expression works for me, but I would need 'regexmode' and 'regexhint' on formattedfield.

Is it possible to add these?

Regards,
Mario
mbreyer

Power User

Joined: 02/07/2013 16:08:31
Messages: 42
Location: Cologne
Offline

Hi,

the solution with a regex is just the half solution for us, as it only hints that an input is false but doesn't prevent it.

I ask again is it possible to add the Attributes 'regexmode' and 'regexhint' on formattedfield?

Regards,
Mario
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team