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
Deanna Aaron 4Deanna Aaron 4 

Help: Field is removing additional 0's after decimal.

Hi there,

I have a geolocation field capturing latitude and longitude. There's a requirement to capture at least 6 digits after the decimal. I have a validation rule that works (yay!), but the fields seems to remove extra zeros after the decimal after saving (which we don't want).

For example, 12.123400 (should keep the extra zeros), but when saved, but it changes to 12.1234

Validation rule:
AND(
NOT(ISBLANK( Service_Coordinates__c )),
OR(
(((LEN(RIGHT(TEXT( Service_Coordinates__Longitude__s ), LEN(TEXT( Service_Coordinates__Longitude__s )) - FIND(".", TEXT( Service_Coordinates__Longitude__s )))) < 6)))

||

(LEN(RIGHT(TEXT( Service_Coordinates__Latitude__s ), LEN(TEXT( Service_Coordinates__Latitude__s )) - FIND(".", TEXT( Service_Coordinates__Latitude__s )))) < 6)
)
)

Thank you for your help!
SwethaSwetha (Salesforce Developers) 
HI Deanna,
Recommend trying approach mentioned in https://salesforce.stackexchange.com/questions/25114/how-to-format-a-currency-or-decimal-value-without-rounding?rq=1

>Create a formula field of type currency.
>The formula should be Floor(YourfieldGoesHere)
>Add the formula to the page layout(s)

Also see https://salesforce.stackexchange.com/questions/289201/how-to-render-a-currency-field-with-decimal-places-as-specified-on-the-custom-fi

If this information helps, please mark the answer as best. Thank you