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

  • Home
  • SEARCH
  • 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 586849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:08:59+00:00 2026-05-13T15:08:59+00:00

I have the following decimal format previously : private static final DecimalFormat decimalFormat =

  • 0

I have the following decimal format previously :

private static final DecimalFormat decimalFormat = new DecimalFormat("0.00");

So,

it can change :

0.1   -> "0.10"
0.01  -> "0.01"
0.001 -> "0.00"

What I wish is

0.1   -> "0.10"
0.01  -> "0.01"
0.001 -> "0.001"

Is it possible I can achieve so using DecimalFormat?

  • 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-13T15:08:59+00:00Added an answer on May 13, 2026 at 3:08 pm

    DecimalFormat class is not “Thread Safe”. So you are better off having static String variable for this format while you should define the DecimalFormat object within your method required method.

    Static variable:

    private static final String decimalFormatStr = "0.00#";
    

    .

    Local variable in method:

    DecimalFormat decimalFormat = new DecimalFormat(decimalFormatStr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 321k
  • Answers 321k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, you certainly could, but you really shouldn't. Sending information… May 14, 2026 at 12:37 am
  • Editorial Team
    Editorial Team added an answer preg_match_all('/href="([^"]+)/i', $str, $matches); var_dump($matches); May 14, 2026 at 12:37 am
  • Editorial Team
    Editorial Team added an answer Sequel doesn't automatically create models, but you could write an… May 14, 2026 at 12:37 am

Related Questions

I'm having problems understanding how input to the md5 function in MySQL 4.1.22 is
This regex: ^((https?|ftp)\:(\/\/)|(file\:\/{2,3}))?(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3} (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(((([a-zA-Z0-9]+)(\.)?)+?)(\.)([a-z]{2} |com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum))([a-zA-Z0-9\?\=\&\%\/]*)?$ Formatted for readability: ^( # Begin regex / begin
i am using excel 2007... i have the following ranges... D E G H
I have an interesting problem with XSL. We have an XML Input file that
We have an Oracle database that contains IP addresses stored as decimal integers -

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.