0

I feel stupid now, but I am unable to create simple format to my numbers. I am using DevExpress 22.2 controls for WPF. Inside a grid is column, in which is only numbers. Sometimes the numbers have decimal part, and sometimes there is none.

Examples: 96,00000 120,65000 23,12003

I need the round number to be displayed like this '96' and the real number like this '120,65' and '23,12003'.

My WPF code for column:

<dxg:GridColumn Header="Počet/Objem" FieldName="Volume" BestFitModeOnSourceChange="AllRows" BestFitMode="AllRows" AllowBestFit="True">
    <dxg:GridColumn.CellTemplate>
        <DataTemplate>
            <dxe:TextEdit Name="PART_Editor" 
                          HorizontalContentAlignment="Right" MaskType="Numeric" 
                          DisplayFormatString="n"
                          ShowBorder="False" 
                          dxe:NumericMaskOptions.AlwaysShowDecimalSeparator="False"/>
        </DataTemplate>
    </dxg:GridColumn.CellTemplate>
</dxg:GridColumn>

This formating always return numbers with 2 digits after decimal point (comma in my culture).

My resuls: '96,00' '120,65' '23,12'

Please, can someone help me? Thank you.

1 Answer 1

0

Ok ... found answer just a minute after asking ... false alarm and sorry.

DisplayFormatString="#,0.######"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.