Solved

formating numbers

Posted on 2002-03-20
1
196 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
custom annotations 9 38
nextBoolean(double p) for Random class 3 40
eclipse apache tomcat admin console 52 94
tomcat startup error 5 59
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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…

813 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

10 Experts available now in Live!

Get 1:1 Help Now