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
sourabh shresthasourabh shrestha 

Workflow to remove the decimal and add comma to the number value.

Hi,
Please help me in the below requirement.
I have a text field which accepts number value also.
When we put any number having decimal, I want to remove the decimal values and add the comma instead.
Example-   1234.56 should be 1,234
123.45 should be 123. likewise.

Anyother other approach is highly accepted.
Vamsi KrishnaVamsi Krishna
Sourabh
you can use a workflow field update to achieve this..

Create a new workflow rule on your object..
select a rule criteria like YourTextField is not blank
and in your field update select your text field to be updated
then use the below formula

SUBSTITUTE(YourTextField, ".", ",")
Sonam_SFDCSonam_SFDC
Hi Sourabh,

You can use a field update on the record and using the Cieling funtion you can round off the number to the closest possible integer.
https://help.salesforce.com/HTViewHelpDoc?id=customize_functions_a_h.htm&language=en_US#CEILING

the comma you mentioned will automatically be brought up using the locale you choose for the user: https://help.salesforce.com/HTViewHelpDoc?id=admin_supported_locales.htm&language=en_US
as the locale decides the format of the numbers entered in the ORG