function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ReksReks 

small query !

Developer :

Faced below strange scenario regarding <Apex:inputField> component.

I have a number field in my SF org with Number(18, 0)

When I used, inputfield for the number field in my visualforce page, it rounds the value automatically after saving it, when 16 or more digits entered in that.

But after adjusting my Number field to Number(17, 1), the value entered is not getting rounded.

Same thing happens for Number(16, 0), Number(17, 0) and Number(18, 0) as well. By specifying atleast one decimal place, we can get rid of this auto-rounding.

How to work on this ?

Bryn JonesBryn Jones
When you set a number feild you set the max number of digits. As standard it is 18. You need to change this to 16 and the box to the right change to 2 when setting up a new number feild, you can edit this afterwords. 
Bryn