I'm trying to format a negative number in a Webgrid cell to show as (512.35) instead of -512.35
How do I accomplish this? I have tried Format = "($###,###.00)" which gives me ( ) around every number positive or negative.
Thanks in advance!
I just had the same problem. Below is the solution.
Format = "$###,###.00;($###,###.00)"
Brent
I don't think you can use formatting to achieve that. Instead you could try using the Abs method of the Math class before rendering the value to the UltraGridCell.
cell.Value = Math.Abs(-512.35);
But this would work only if your grid is sort of 'Only for data display' purposes. If you want to recover that value again to save it back to database, then you might use some sort of flag to know that value was negative before rendering.