Solved

formating numbers

Posted on 2002-03-20
1
213 Views
Last Modified: 2010-03-31
(1)   i want to format numbers with 3 decimal places..
        DecimalFormat fmt=new DecimalFormat("0.###"); /// it's not giving anything.. the answer was with no         decimals at all..however when i calculated it.. it should give that..!!?!?!

(2)  and how to add the currency type of my country infront of the money like to say  AED 100.00
        AED is like $ and so on..

plz waiting.. for the 2 questions...
0
Comment
Question by:saroosh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
Venci75 earned 30 total points
ID: 6882169
try this:
java.text.DecimalFormat df = new java.text.DecimalFormat("AED  #,000.000");
System.out.println(df.format(1123223.5));
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
going to wrong jsp page 2 69
Why doesn't this text field show up on my Applet frame? 2 43
How to fix  socket closed error 11 64
Java regex 5 21
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question