Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:04:01+00:00 2026-06-17T14:04:01+00:00

Is there a number format that would produce a localized number without the thousands

  • 0

Is there a number format that would produce a localized number without the thousands separator?

 Globalize.format("1000.12", "n?" )

I realize I could do:

Globalize.culture().numberFormat[","]="";

But I have some fields where I want it off and some where it should be on. For example… If the value is:

1000.123 -> Want it to show formatted to 1000,12 or 1000.12 depending on locale..But without the thousands separator.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:04:03+00:00Added an answer on June 17, 2026 at 2:04 pm

    You can use the “d” format instead of the “n” format to exclude the thousands separator.

    Globalize.format(1000.12, "d");
    

    Edit
    Note that this will only work if you don’t care about the decimal part.

    If you care about the decimal part, as far as I know, you can’t exclude the thousands separator except through one of the following methods:

    1. Set the thousands character in the culture object to an empty string:

      Globalize.culture().numberFormat[","] = "";
      Globalize.format(1000.12, "n");
      

      You could turn this into a utility function fairly easily:

      function formatNumberNoThousands(num, format, culture) {
          var numberFormat = Globalize.cultures[culture || Globalize.culture().name].numberFormat,
              thousands = numberFormat[","];
          numberFormat[","] = "";
          try { return Globalize.format(num, format, culture); }
          finally { numberFormat[","] = thousands; }
      }
      
    2. Perform a replace on the string result of the format:

      Globalize.format(1000.12, "d").replace(new RegExp("\\" + Globalize.culture().numberFormat[","], "g"), "");
      

      Which can also be easily turned into a utility function:

      function formatNumberNoThousands(num, format, culture) {
          return Globalize.format(num, format).replace(new RegExp("\\" +  Globalize.culture(culture).numberFormat[","], "g"), "");
      }
      

      With this approach, if you know there will never be more than one thousands character in the formatted result you can remove the regexp. Otherwise if you plan on using this a lot or inside of a loop, you will want to cache the regexp and re-use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to format a number so that there is a comma seperating the
Is there a way to format in PHP a number always keeping its sign
I have an unformatted telephone number string (5551234567). I would like to format this
I have a file with a specific format that I would like to parse.
Is there an easy way in PowerShell to format numbers and the like in
Is there a format for phone numbers which all numbers will fit into? (something
I have an images array in which there are number of images. Not fixed,
Here is the jsfiddle for what I was testing http://jsfiddle.net/5hhRF/ there is number 1
There are a number of examples out there but yet I can't seem to
There are a number of JSON libraries available for Erlang, and it's not clear

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.