I am using this: \r\n \r\n<%# DataBinder.Eval(Container.DataItem, "Price","{0:c}") %> \r\n \r\nto bind an item in a repeater control. \r\nI need to round off the decimal to either .99 or .00 only. \r\nI can\'t change this through the stored procedure as other items use the \'raw\' format. \r\nI have tried converting to double so I can use Math.Round but that rounds off to the nearest dollar with no decimals. \r\nI have researched other numeric formats but none has anything about rounding off the decimals. \r\n \r\nThanks in advance. \r\n \r\nEduardo
to bind an item in a repeater control.
I need to round off the decimal to either .99 or .00 only.
I can't change this through the stored procedure as other items use the 'raw' format.
I have tried converting to double so I can use Math.Round but that rounds off to the nearest dollar with no decimals.
I have researched other numeric formats but none has anything about rounding off the decimals.
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe