Home
Analytics
To display a string in decimal format
Sankari
Hi All,
I am badly in need of displaying a string in decimal format(with $,Thousands seperator ).
Please help me in this.
Thanks In advance
Sankari
Find more posts tagged with
Comments
mwilliams
You have a string that you want to display as a decimal? If your string is like "100000", you could use something like the following in a computed column in your dataSet or as a data binding in your table:
myDecimal = parseFloat(row["myStringField"]);
myDecimal;
If it's in a format like "100,000", you could remove the ',' and do the same as above or do something like:
df = new java.text.DecimalFormat("#,###");
myDecimal = df.parse(row["myStringField"]);
myDecimal;
Now you have a decimal value that you can use the FormatNumber section of the property editor to format the number how you'd like.