Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » format mask for number
format mask for number [message #624212] Fri, 19 September 2014 02:18 Go to next message
Mayur Shinde
Messages: 60
Registered: August 2014
Location: Pune, Maharashtra
Member
Hi all,

On my form their is one text item. I have assign a format mask; as if I insert 100.30 then it will return 100.


e.g.
entered expected result
--------------------------------
1000.60 1001
100.20 100
500.90 501


I set format mask to 9999; when I entered 1000.50, it displays message i.e. FRM-40209: field must be of form 9999.

Please suggest me.
Re: format mask for number [message #624216 is a reply to message #624212] Fri, 19 September 2014 02:37 Go to previous message
Littlefoot
Messages: 21616
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you set a format mask, Forms expects you to enter values according to that format.

As you want to ROUND entered values, remove format mask from item's property andcreate a WHEN-VALIDATE-ITEM trigger on that item:
:block.item_name := round(:block.item_name);


[EDIT]

Oooops! Sorry, I didn't realize that it is an Apex form! In that case, remove format mask and create a dynamic action; its code would be similar to the Forms' trigger:
:ITEM_NAME := ROUND(:ITEM_NAME);

Which dynamic action to choose? PL/SQL or Set Value might be your choices.

[Updated on: Fri, 19 September 2014 02:39]

Report message to a moderator

Previous Topic: Dynamically Change Datatype
Next Topic: Large Data into Page
Goto Forum:
  


Current Time: Sat Oct 31 03:10:35 CDT 2020