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
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!
Debra M 5Debra M 5
When you set a field as a number, commas will be applied automatically. To avoid the commas. you have to set the field as text so numbers will be treated as text. That is how we do it in ERP Softwares (https://www.truebays.com/erp-software-dubai/) too.
Stephen max 1Stephen max 1
Hi I was finding this solution for this Crushed Glass Chips (https://bsgglasschip.com/)
jhon addijhon addi
You could create a formula field. The other option like you said, is to use a text field that will apply no formatting.

Regards: driving checklist (https://www.nationalaccidentsupportline.co.uk/checklist-new-drivers-check-driving/)
 
howdy rawnhowdy rawn
Best option is to use a formula field, output type as Text, and make the formula be your Number field. The intent of the formula text field is then just to display your Number as unformatted text, and it will display without the commas. I also have Comma Problem in my website: https://ihomedental.com/
David MichelDavid Michel
Incoming value may not always be a string. If the incoming value is a numeric the replace method won't be available and you'll get an error. Suggest using isNaN to see if numeric, then assume string and do replacement otherwise.
if(isNaN(x)) {
    x = parseInt(x.replace(/[,]/g,''));
}
(Not foolproof because 'not number' doesn't prove it is a string, but unless you're doing something very weird should be good enough). You can also add other symbols to the character group to remove other stray chars (such as currency symbols).

LiteBlue (https://www.liteblue.app/)
Tapas DasTapas Das
Your answers are listed on this page, everyone suggested good information. 
if you want to download full screen WhatsApp Status then visit - Full Screen Status WhatsApp Status Download (https://fullscreenstatus.in)
Tapas DasTapas Das
Your answers are listed on this page, everyone suggested good information and easy to understand. 
if you want to read food recipes then visit - ChilliOnFire.com (ChilliOnFire.Com)
me statusvideome statusvideo
If you want to whatsapp status video download (https://mestatusvideo.com/30-seconds-whatsapp-status-video-download/)for free in the category of high quality Whatsapp status video

 
Aryan Gupta 11Aryan Gupta 11
Best site to learn about digital marketing SEO and making money online is blogeva.com (http://Blogseva.com)
Biswajit BhadraBiswajit Bhadra
Thanks for posting such posts here.
Whatsapp Status Video (https://statusour.com)
New Status Video (https://pagal4status.com)
lite bluelite blue
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work.

Liteblue (https://liteblue.tech/)
Stella VGStella VG
Use text field and it will avoid commas, check our erp software: https://www.softwareindubai.com/erp-dubai/
Silvia AndersonSilvia Anderson
We recommend the use of text field, as it helped us to easily overcome the issue in several instances. I also believe that several ERP software solution providers who offer HR and Payroll Software Dubai (https://ebrsoftware.com/hr-and-payroll-software-dubai/) recommend the very same method 
Kendra SmithKendra Smith
Your thoughtfulness and support have meant so much to me, and I am grateful to have you in my life. I feel very fortunate to have someone like you who cares and understands me. https://dramacoolz.video/
erpsoftware UAEerpsoftware UAE
Excellent post! I must thank you for this informative read.
For ERP Software visit ERP Software UAE (https://erp-software-uae.ae/)
baner punepbaner punep
To remove a comma from a number field, you can use the following steps depending on the programming language or context you are working with.
Thanks from ERP Software Dubai (https://www.penieltech.com/erp-software-uae-dubai.php) - Team