This content has been marked as final. Show 7 replies
10 is a number but 10.00 is not a number and it's a formatted number...so it's a string.
So if you enter 10.00 in a number field it does convert that into 10. For this to work, you need to create that column as of type VARCHAR2 in OAF...I mean attribute of type String and then validate.
Even if you set it to VARCHAR2 in OAF, but still when you store this value in DB, it still stores as 10 but not 10.00 as it's a number field. Oracle DB also doesn't consider 10.00 but 10.
If you want to display it as 10.00, you can always display by formatting the number field.
Please take your call accordingly.
Thanks a ton Peddi for explanation. Actually i tried setting the field as Varchar2 in OAF..still when i click on Add another row button it converts 10.00 as 10
My issue is not storing it in DB...on page the user has to enter values with 2 decimals...and until the page is submitted it should show the way user has entered data...
In this case eg if he lclicks on Add another row so page is submitted parially and the 00 are removed. So can you please suggest...
There are two places where you set the data type.
1) At the VO/EO attribute level
2) At the column of the table/advanced table bean level.
Make sure both of them are of type VARCHAR2.
While comparing also you get that into a string...rather than a number. I think you are already doing it.
Peddi my doubt is : i am not interested if in database it stores it as 10.00 or 10
only when the user enters data on page..it should stay as 10.00 when user performs any action..so do you really think i need to change VO/EO...as its just for client side validation and nothing related to server side validation...please advice..