Groups | Blog | Home
all groups > asp.net > march 2007 >

asp.net : Display Integer without decimal


pargat.singh NO[at]SPAM gmail.com
3/25/2007 5:36:40 PM
Hi Everyone:

I have a grid view which is bound to dataset from oracle store
proceduer. I have a number filed but it is showing in decimal like
0.0000 or 24.0000 etc. Can someone please tell me how can show o or 24
only without decimal. I tried dataformatstring prorerty of bound field
but no luck.

Thanks in advance.

Pargat
Jon Paal [MSMD]
3/25/2007 6:52:31 PM
Returns the integer portion of a number.

Int(5.3333) returns 5.


[quoted text, click to view]

Mark Rae
3/26/2007 12:00:00 AM
[quoted text, click to view]

You probably forgot to include:

HtmlEncode="false"

in the bound column tag

pargat.singh NO[at]SPAM gmail.com
3/26/2007 6:13:56 AM
[quoted text, click to view]

Thanks. I am getting an error when i set DataFormatString="{0:D}"
HtmlEncode="false".
pargat.singh NO[at]SPAM gmail.com
3/26/2007 6:34:29 AM
On Mar 25, 9:52 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
[quoted text, click to view]

Thanks. I have replace the SP with to_number.
Mark Rae
3/26/2007 3:07:29 PM
[quoted text, click to view]

DataFormatString="{0:0}" HtmlEncode="false"

AddThis Social Bookmark Button