![]() |
Cutting a string down to size.
Hi,
I'm having trouble displaying numbers like 10.9900 as 10.99. My sql database holds the numbers such as 10.9900 and when I'm using my site i want the page to retrieve the number but cut the 2 zeros off of the end. I've found a way of cutting out the first 2 numbers... Code:
testString.Substring(testString.length - 2)Thanks. |
Re: Cutting a string down to size.
Try this
Code: CSharp
|
Re: Cutting a string down to size.
Hi, That works perfect. What does it do exactly? does it do something on the database level? I've never come across this before and its quite interesting. Thanks.
|
Re: Cutting a string down to size.
That just formats the string to have 2 decimal places, simple! :-D
|
| All times are GMT +5.5. The time now is 10:48. |