[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Request for formated numeric field with own pattern  XML
Forum Index -> Development
Author Message
schmuck

Power User
[Avatar]

Joined: 08/04/2008 16:27:16
Messages: 83
Offline

Hello,

I would like to have a formated field, that I can give a pattern like with the decimal format object.

e.g. pattern: "###,##0.00 €" the field contains a formated currency like (double)"12345.67" -> (String)"12.345,67 €"

The user should be able to input a numeric value with and without the € symbol. ( input: "10" or "10€" or "10,79" or "99,99 €")

Mapped to the bean should only be a double value.



Currently I use String Accessor methods and I am parsing the content by myself in this methods, but sutch a formated filed would be very convienient!

Thanks,
Michael Schmuck

[ICQ]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Does not sound to be too far from being resaonable...
We'll check...
Björn

Björn Müller, CaptainCasa GmbH
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Hi,

from next update on you can define the number of digits so that numbers are displayed in the way "###.###.###,##" (or ###,###,###.## or ###'###'###,## dependent from Locale). With the prefix/suffix we are still fighting...

Björn

Björn Müller, CaptainCasa GmbH
schmuck

Power User
[Avatar]

Joined: 08/04/2008 16:27:16
Messages: 83
Offline

prefix suffix is not so important than defining the pattern.

maybe you could apped an property with an list of chars with would be replaced to "" (String of length 0) - e.g. "€" replaced to "" so you can parse the value to double.

or you add an property (true/false), that indicates that all none numeric chars in input string would be replaced with ""

finally the getter provides the formated string like "###,##0.00 €"


Thanks,
Michael Schmuck

[ICQ]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

...today's update contains the following impovement: when using float/double/bigdecimal as format for FORMATTEDFIELD then you can define "dec1","dec2",... in the FORMATMASK field (see value help). The formatting will be corresponding.

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team