CommunityToolkit
                                
                                 CommunityToolkit copied to clipboard
                                
                                    CommunityToolkit copied to clipboard
                            
                            
                            
                        Really need more examples on how to use expressions other than the default * / + -
Really needs more examples of expressions for (Multi)MathExpressionConverter other than the default multiplier(*), divider(/), addition(+) and subtraction(-), I kind of expected "round(x * y)" to work but it's not valid. How do I round numbers, for example, within my XAML binding?
[Enter feedback here]
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 2071da01-e383-561c-9eca-685d03549c32
- Version Independent ID: 2071da01-e383-561c-9eca-685d03549c32
- Content: MathExpressionConverter - .NET MAUI Community Toolkit - Community Toolkits for .NET
- Content Source: docs/maui/converters/math-expression-converter.md
- Product: dotnet-communitytoolkit
- GitHub Login: @VladislavAntonyuk
- Microsoft Alias: joverslu
We should provide better examples on what is possible within the MathExpressionConverter for now if you want to use it for rounding I think the following expression should work:
"round(x, 2)" - this will round the value in x to 2 decimal places.
We should provide better examples on what is possible within the
MathExpressionConverterfor now if you want to use it for rounding I think the following expression should work:
"round(x, 2)"- this will round the value in x to 2 decimal places.
Ahh I simply forgot about the decimal places value! Looks like it works after all. Thanks for clarifying! By the way, also thanks for the great book "Introducing .NET MAUI", it is very helpful to get started.