+ Start a Discussion
Shahab KhanShahab Khan 

How to remove comma from Number field

Hi,

I have a number field (Number, 0) but when i put valuee 10000 in it it will diplay it as 10,000 i want to display it without comma.
I have selected number field because i need to select Max number from it and add 1 in Max number for new entry.
Can any body help me how i can do it.

Thanks,
Faraz
Best Answer chosen by Shahab Khan
Grazitti TeamGrazitti Team
Hi Shahab,

Create a new custom field, where type is "formula" and the formula return type is "text".

In the formula, use the TEXT() function, and pass the existing number field value into this formula. For example, if your number field is MyNumber_c then your formula would be: TEXT( MyNumber_c )

Your users will enter values into the existing number field, but you can use the formula field (which doesn't display thousands separators)


And don't forget to mark this answer as best, if answer this helps you :-)


--
Regards,
Grazitti Team
Web: www.grazitti.com

All Answers

Grazitti TeamGrazitti Team
Hi Shahab,

Create a new custom field, where type is "formula" and the formula return type is "text".

In the formula, use the TEXT() function, and pass the existing number field value into this formula. For example, if your number field is MyNumber_c then your formula would be: TEXT( MyNumber_c )

Your users will enter values into the existing number field, but you can use the formula field (which doesn't display thousands separators)


And don't forget to mark this answer as best, if answer this helps you :-)


--
Regards,
Grazitti Team
Web: www.grazitti.com
This was selected as the best answer
Vatsal KothariVatsal Kothari
Hi Faraz,

You can do this by creating Text field, I think for Number field you are querying for Max(Number) , so for text field you can retrieve last created record, retrieve value of string and convert the string into integer using integer.valueof(s); and add 1 in it.

If this solves your problem, kindly mark it as the best answer.

Thnaks,
Vatsal


Nagarjuna ReddyNagarjuna Reddy
Hi Vatsal Kothari,

I am very glad that you are very active in Forum.
I want to ask you if there is any way through trigger to hide a field.

If we can do that, then in the above senario, he can take a number field and then a text field field with formula displaying the same number which is entered in the number field. After save he have to hide that number field through trigger so that in the front end he can show up only  one field.  He can also perform his calucations on number as usual..

What do you say???
Vatsal KothariVatsal Kothari
Yes you can hide it. You just have to remove that number field from page layout.

Nagarjuna ReddyNagarjuna Reddy
Yes I know, through page layout we can do that. But If we do through pagelayout he can not enter a value in the number field since it is hidden.

But after entering the number on click on save formula runs and text field will be displayed with that number with out cama.

Then trigger have to hide Number field after insert.
Vatsal KothariVatsal Kothari
No we can not hide field throgh trigger., either we make it read only or remove it from page layout.
So its better dont give access to user  to entering the value. Update the field using trigger only, take the last value and add 1 in it.
Or you can create a visulforce page which contains number field, which we will call on edit button and after saving display another page which contains formula field. 
Shahab KhanShahab Khan
Thanks Grazitti Team you are 100% right i have done it before your reply same as you explained.

sales.forcesales.force
I would not resort to a custom visualforce page for this simple problem.

To display a number without a comma, convert the field data type from a Number to Text. If you want to prohibit A-Z characters then create a validation rule to make sure only numbers are entered into this new field.

You don't need a number field to find the Max value. Instead you would convert the text to a number and then find the max value by using the Value(Text) formula in your calculations. The Value(text) function converts a text string that represents a number to a number.
Ron KaganRon Kagan
Per @sales.force:
>  If you want to prohibit A-Z characters then create a validation rule to make sure only numbers are entered into this new field.
NOT(ISNUMBER( Your_Text_Field__c ))
Naresh ReddipalliNaresh Reddipalli
Superb and one line answer @sales.force
KOUSHIK SARKARKOUSHIK SARKAR
Thanks for your great article! Status Video Downlaod  (https://pagalstatus.com/category/whatsapp-status)
Harsh LahreHarsh Lahre
Really helpful to me. as I expected.

Font Generator (https://fancyfont.allinhindi.co.in/" target="_blank)
gfdhg gfdggfdhg gfdg
I have test this scripts on my dynamic blog that hosted on WordPress. I have made  a program for espresso beans reviews (https://bestespressobeans.net/espresso-beans-brewing-machines/) that hosted for dynamic blog.
Baya AdamBaya Adam
My Articles (https://myarticles.io/) is a writer’s community where writers can share their stories all over the world. Signup and share your stories to all over the world. Follow your favorite writers, create groups, forums, chat, and much much more!