Alain
Alain

Reputation: 27220

How can I format a number but show all digits of precision?

When a user goes to edit a number, I want to format a number to have a thousands separator in one case (and a percentage sign in another) but I want to be able to show absolutely all available digits of precision.

When the number is being displayed, its format is simply {0:0,0;-0,0; - }, (or {0:0,0.00;-0,0.00; - } to show two decimal places), but when my control goes into edit mode, I want to switch to displaying something very similar, but showing all available digits of precision. Is there any way to do this short of creating a format string that looks like this?

{0:0,0.#############################;-0,0.###...

I want to do something similar with percentages. I want to displayed value to be {0:0.00 %;-0.00 %; - } until the user activates the cell for editing, at which time the format should still be a percentage, but showing more digits of precision if they exist in the underlying value.

Thanks

Upvotes: 1

Views: 1513

Answers (1)

dillenmeister
dillenmeister

Reputation: 1647

This question is similar to yours. (The answer is that it's not possible with the .NET built-in custom numeric formatting.)

Upvotes: 1

Related Questions