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 6988839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:08:00+00:00 2026-05-27T19:08:00+00:00

I am using NumberFormat.getCurrencyInstance(myLocale) to get a custom currency format for a locale given

  • 0

I am using NumberFormat.getCurrencyInstance(myLocale) to get a custom currency format for a locale given by me. However, this always includes the currency symbol which I don’t want, I just want the proper currency number format for my given locale without the currency symbol.

Doing a format.setCurrencySymbol(null) throws an exception..

  • 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-05-27T19:08:01+00:00Added an answer on May 27, 2026 at 7:08 pm

    The following works. It’s a bit ugly, but it fulfils the contract:

    NumberFormat nf = NumberFormat.getCurrencyInstance();
    DecimalFormatSymbols decimalFormatSymbols = ((DecimalFormat) nf).getDecimalFormatSymbols();
    decimalFormatSymbols.setCurrencySymbol("");
    ((DecimalFormat) nf).setDecimalFormatSymbols(decimalFormatSymbols);
    System.out.println(nf.format(12345.124).trim());
    

    You could also get the pattern from the currency format, remove the currency symbol, and reconstruct a new format from the new pattern:

    NumberFormat nf = NumberFormat.getCurrencyInstance();
    String pattern = ((DecimalFormat) nf).toPattern();
    String newPattern = pattern.replace("\u00A4", "").trim();
    NumberFormat newFormat = new DecimalFormat(newPattern);
    System.out.println(newFormat.format(12345.124));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am using my onEditTextchanger. To format my currency. What I am wondering
I'm using this code to get an int value from 3 different servers: $js
I'm trying to format a currency (Swiss Frank -- de-CH) with a symbol (CHF)
I am having some trouble using the custom number format feature in Excel to
There is a similar question on SO which suggests using NumberFormat which is what
My web app runs fine after I changed the system locale however whenever files
I have this number: $double = '21.188624'; After using number_format($double, 2, ',', ' ')
I am using C# to try and format a range in Excel as numbers.
I would like to convert a possibly Decimal value prefixed with currency symbol into
I am trying to find the best route to get in some Custom formats

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.