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
Solved

formating numbers

Posted on 2002-03-20
1
202 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
type mismatch (Object[] to double[] 4 33
how to install java on RHEL image on EC2 4 39
SequenceInputStream example 3 19
Is there a simpler dropbox system? 10 34
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

809 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