abu bucker

Greenhorn
+ Follow
since Jul 04, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by abu bucker


Hi

I have a requirement where in the parent window should be redirected on close of the Modal dialog window. I'm not able to access the parent page form the 'onUnload' event of the modal dialog. can anyone please help me out with this.

Matthew Brown wrote:

abu bucker wrote:

Jeff Verdegan wrote:you're talking about what you want from the String, not what you want from the double.

I want the Double as .001 and not as .0010 after its converted from String to Double.

Although the above two values are same but this value is being stored in the DB and we are having some issues when the value is being stored as .0010 instead of .001.


What everyone is trying to tell you is that Double does not have an inherent format, so what you're asking for doesn't make sense. It has a value only. If you want to control what that value looks like when it's printed out....in other words, when it's converted to a string.... then you use DecimalFormat.



I know that Double does not have an inherent format but i was looking for a way to limit the number of digits after the decimal point for a Double.
11 years ago

Winston GutkowskiI think you're missing the point. Your code already [i wrote:has[/i] the value as a Double - in 'd'.

You seem to want System.out.println() to magically format your Double value exactly the way you want; and it WON'T.

Winston



You are getting taking it in a wrong way.

The code that i have written is the simplified example of my actual code and the sysout was to only display the value.

All i want is that when i convert the String "00000.001" to a Double, the format should be 0.001 instead of 0.0010.
11 years ago

Jeff Verdegan wrote:

you're talking about what you want from the String, not what you want from the double.



I want the Double as .001 and not as .0010 after its converted from String to Double.

Although the above two values are same but this value is being stored in the DB and we are having some issues when the value is being stored as .0010 instead of .001.
11 years ago
The format method of DecimalFormat returns the value as a String but i want the value as Double.......

Check my code
11 years ago
@Mike
Yes you got it rite.

I will try with DecimalFormat and check.
11 years ago
Hi,

I'm trying to convert a string value "00000.001" to a Double and have used the usual converting methods like using constructor, valueOf and parseDouble methods but i'm getting output as .0010 but i want the output as .001 can anyone help me out with this...
11 years ago
got it.
i have set the font-family to monospace(fixed width)
now its working
thanks.....
hi
i have created a text area using the <form:textarea> tag and given rows="4" and cols="70". so ideally i should be able to enter 70 characters per line.
when i enter all characters in small it is wrapping the 71st character to the next line. but when i enter all in CAPS it wraps it to the next line well before the 70'th character.
i.e it wraps to the next line at 50'th character.