Solved

formating numbers

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now