Anyone, I know that there are ways/methods that convert a "string" to a "numeric/double/int/etc.", however is there a way to convert a numberic to a string? The reason that I ask is because I am wanting to "truncate" the value of a double variable. Unlike C/C++, I cannot use "precision" with some type of conversion specifier to do this. I was thinking about converting the double to a string and outputting only the digits that I want displayed, in effect, truncating the variable's value. Any feedback would be welcomed. Thanks in advance.
Joined: Feb 08, 2001
Try valueOf method in String class [ it gives string representation of int , float etc. ] Then, use the subString method to extract the value upto a point you desire. Hope this helps. jytsika