cancel
Showing results for 
Search instead for 
Did you mean: 

Format (Mask) an input field for a total sum

david_fryda2
Participant
0 Kudos

Hi everyone,

Is there a way to format (mask) an input field in order to get a sum like 1,000,000.45 ?

Thanks.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Define a DDIC type with that format and bind the "value" property to an attribute of this DDIC type.

Armin

david_fryda2
Participant
0 Kudos

Hi,

What type do I have to choice ? The decimal one ?

Where do I define de mask and digits after the point (like 1,000.45) ?

Thanks.

Former Member
0 Kudos

Use "decimal" as built-in type, specify total and fraction digits, format may be set in register card "Representation".

Should be documented somewhere.

Armin

david_fryda2
Participant
0 Kudos

Hi,

Can you explain ehat is "format may be set in register card "Representation" ?

Thanks.

Former Member
0 Kudos

The DDIC type editor in NWDS has several tabs, one of them is named "Representation", there you can set a format.

Armin

david_fryda2
Participant
0 Kudos

Thanks Armin for the help.

I put in the format for example : 1,000.00.

When the user enters un number and press ENTER, it should format it ?

Regards.

Message was edited by: David Fryda

Former Member
0 Kudos

As far as I know, the format pattern follows the java.text.DecimalFormat conventions, e.g. "###,##0.00".

In the input field I would expect that the value is formatted after each roundtrip, so you might assign an empty action to InputField.onEnter and press ENTER to see the formatted value.

Armin

david_fryda2
Participant
0 Kudos

It works.

Thanks again!!!

Regards.

Answers (0)