How to set customized currency symbol in Xamarin.Forms numeric controls?
The numeric text box or numeric up-down controls can have a custom string in its value. It can be specified by setting the “FormatString” property.
Setting the custom string
Change the ‘FormatString’ property of SfNumericUpDown or SfNumericTextBox with custom format string, e.g., USD 0.00. For more available custom formats, refer to this documentation.
Code Snippet [C#]:
namespace CustomCurrency_Numeric { public partial class MainPage : ContentPage { public MainPage() { InitializeComponent(); …. SfNumericUpDown numericUpDown = new SfNumericUpDown() { … Value = 100, FormatString = "USD 0.00", … }; … SfNumericTextBox numericTextBox = new SfNumericTextBox() { … Value = 1000, FormatString = "USD 0.00", … }; … } } }
Code Snippet [XAML]:
<Grid> … <upDown:SfNumericUpDown Grid.Row="1" Value="100" FormatString="USD 0.00"/> … <textBox:SfNumericTextBox Grid.Row="3" Value="1000" FormatString="USD 0.00"/> </Grid>
Output:
I hope you enjoyed learning about how to set customized currency symbol in Xamarin.Forms numeric controls.
You can refer to our Xamarin Numeric control's feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our Xamarin controls from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!