Results 1 to 8 of 8
Thread: Dollar sign and DecimalFormat
- 04-05-2011, 05:14 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
Dollar sign and DecimalFormat
Hi everyone,
I hope you are having a nice day,, I've variable that has to be with the dollar sign for example $10.00 and I used the following line of codes
Java Code:DecimalFormat numberformat = new DecimalFormat("$ ##,###.##"); String PSALESIN;
Java Code:PSALESIN = numberformat.format(Integer.parseInt(PRODUCTSALESPRICEIN.readLine()));
The problem with the previous code is give me out put such as $10
your help is really appreciated,,
- 04-05-2011, 05:24 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
DecimalFormat (Java Platform SE 6)
# [...] zero shows as absent
-->
:confused:Java Code:"$##,###.00"
- 04-05-2011, 05:29 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
Thank you so much,, I like the face that you put it at the end,,
also I have faced a problem with the following code which should create a random number .. could you please take a look on it because it gave me a REPEATED VALUE..
Thanks in advanced ,,Java Code:Calendar CURRENTDATE = Calendar.getInstance (); int CURRENTTIME = CURRENTDATE.get (Calendar.MILLISECOND); int CURRENT9 = 50; int RANDNUMBER = 560; int NUM = CURRENTTIME + CURRENT9; int SIDOUT = (RANDNUMBER / CURRENT9) + NUM; int PIDOUT = (RANDNUMBER / NUM) + NUM; PIDOUT = RANDNUMBER + PIDOUT; SIDOUT = RANDNUMBER + SIDOUT; SIDOUT = PIDOUT + SIDOUT; PIDOUT = SIDOUT + PIDOUT; int PID = PIDOUT / CURRENT9; int PIDOUT1 = PIDOUT % CURRENT9; int SID = SIDOUT / PID; int SIDOUT1 = SIDOUT % PID;
- 04-05-2011, 05:36 PM #4
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
:confused: Which value?!because it gave me a REPEATED VALUE
This question has nothing to do with the initial question or?
- 04-05-2011, 05:41 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
this algorithm should give me a new number in each line for example ,
102232
213093
213302
109032
but unfortunately it gave me results same as the following which is not correct
1233
1233
1233
4323
4323
5334
5334
Hope it is clear..
- 04-05-2011, 11:38 PM #6
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
I am so sorry but if there is any help for this problem that will be great.
I know I can use the random class in Java but the problem is I have to use this algorithm and I have to fix it..
- 04-05-2011, 11:44 PM #7
Member
- Join Date
- Apr 2011
- Location
- Athens, Greece
- Posts
- 52
- Rep Power
- 0
Mate that is a totally different question than the one you did at first. Open a new thread so people can help you and mark this as solved... :)
- 04-05-2011, 11:57 PM #8
Member
- Join Date
- Mar 2011
- Posts
- 27
- Rep Power
- 0
Similar Threads
-
Dollar sign in a while statement
By oneprotect in forum Advanced JavaReplies: 3Last Post: 01-18-2011, 11:01 AM -
locale and decimalFormat confusion
By bz3x in forum New To JavaReplies: 2Last Post: 05-23-2010, 12:22 AM -
problem sending Dollar symbol in SMS
By neerajsaxena in forum Advanced JavaReplies: 1Last Post: 01-28-2010, 06:37 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM -
DecimalFormat class
By Java Tip in forum Java TipReplies: 1Last Post: 12-30-2007, 03:09 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks