Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
520
Formatting XamCurrencyEditor
posted

Hi,

I m using Infragistics grid with XamCurrencyEditor with the following mask,

 ValueEditor.RegisterDefaultEditorForType(typeof(double), typeof(XamMaskedEditor), true);

string digitAfterDecimal = "{double:-25.2:c}";  

XamCurrencyEditor.RegisterDefaultMaskForType(typeof(decimal), digitAfterDecimal);

 

The above mask displays all the data with two decimals (for ex. 25.89, 1,475.25, 478.00)

 

But my requirement is to displat data like this (with zero values suppressed),

25.89
1,475.25
478

Can somebody help me in this regard?

  • 69686
    Suggested Answer
    posted

    Hello,

    The mask that you have specified forces the editor to always display two digits after the decimal point. If the values does not have them, they will be filled out with zeros. You have to use another mask to do this - a mask which has non-required digit placeholders after the decimal point. For example, the "n" token in a mask is a non required placeholder. You can see different masks here,