Posted 8 September 2017, 1:43 pm EST
I have a spread control where users can enter prices. I want the cells to display only 2 decimal places. However, if the user wishes to enter more than two decimal places, the cell should allow that. Say a particular price is 12.345. I want the cell to accept 12.345, but display 12.35.
I've tried the NumberCellType with DecimalPlaces = 2, but that prevents the user from entering the 5 in 12.345. I've also tried the GeneralCellType with FormatString = "#,###.00" which allows the 3 decimal places and rounds up to 12.35. Good so far. However, when it's time to save this price to the database, both the cell's Text and Value property contain 12.35. Where should I look to find 12.345? I assume its stored somewhere? Also, if the user does a cut or copy from this cell, how can I get 12.345 onto the clipboard?
Any help is greatly appreciated. Thanks.