Stringformat - Display as hex not working
See original GitHub issueNo matter what I try, I cannot get an int/long/ulong value to show as hex decimal in Avalonia:
<DataGridTextColumn Binding="{Binding Value, StringFormat={}{0:x}}" Header="Abc" />
<DataGridTextColumn Binding="{Binding Value, StringFormat='{}{0:x}'}" Header="Abc" />
<DataGridTextColumn Binding="{Binding Value, StringFormat='{0:x}'}" Header="Abc" />
<DataGridTextColumn Binding="{Binding Value, StringFormat='\{0:x\}'}" Header="Abc" />
<DataGridTextColumn Binding="{Binding Value, StringFormat=X}" Header="Abc" />
What am I doing wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
c# - String.Format for Hex
It looks like you want to send the data to some HTML CSS renderer (because of the #HEX format). Actually CSS wants you...
Read more >Standard numeric format strings
In this article, learn to use standard numeric format strings to format common numeric types into text representations in .NET.
Read more >C# Hexadecimal ("X") Format Specifier
The hexadecimal ("X") format specifier is used to convert a number to a string of hexadecimal digits. Set the case of the format...
Read more >How to use the new FormatStyle to format an Int to hex?
The new FormatStyle let n = 0xdeadface print("n =", n.formatted(.number.how-to-do-upper-case-hex)) // I want: n = 0xDEADFACE // same as ...
Read more >sprintf - Manual
Returns a string produced according to the formatting string format . ... x, The argument is treated as an integer and presented as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Symbai I suggest you to create a simple repro.
@Symbai just checked in control catalog:
Works fine:
What am I doing wrong?