Accept dot from keypad as comma in DEC

m.hansler

New Member
Hi all,

I have a decimal var and a user has to input an amount.

For input the keypad is used. But the dot on the keypad doesn't work.
The NUMERIC-FORMAT is "European" btw.
How can I use the dot on the keypad as the decimal delimiter.

ON "." OF dMeters
DO:
???
END.
 
Hi all,

I have a decimal var and a user has to input an amount.

For input the keypad is used. But the dot on the keypad doesn't work.
The NUMERIC-FORMAT is "European" btw.
How can I use the dot on the keypad as the decimal delimiter.

ON "." OF dMeters
DO:
???
END.


/* this will do the trick */
ON ANY-PRINTABLE OF dMeters
DO:
IF KEY-LABEL (LASTKEY) = "."
THEN DO :
APPLY KEYCODE(",").
RETURN NO-APPLY.
END.

END.

cheers
Ruud
 
Thanks Ruud.

Works like a charme (ofcourse).
If I read the code out loud it's so obvious ;)
Logic, pure logic. In a UI it's just those little details that make it good.

Grtz.
Marco
 
Back
Top