Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringFormat='{0:c}' doesn't show dollar sign in .NET MAUI 9 #26183

Closed
imsam67 opened this issue Nov 28, 2024 · 5 comments
Closed

StringFormat='{0:c}' doesn't show dollar sign in .NET MAUI 9 #26183

imsam67 opened this issue Nov 28, 2024 · 5 comments
Labels
area-xaml XAML, CSS, Triggers, Behaviors i/regression This issue described a confirmed regression on a currently supported version platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@imsam67
Copy link

imsam67 commented Nov 28, 2024

Description

The following code does not display a dollar symbol. Instead, it display some other symbol -- see image below:

<Label
   Text={Binding Amount, StringFormat='{0:c}'}
   TextColor="Black" />

Here's what it shows instead:
Image

This was working perfectly in .NET 8.

Steps to Reproduce

In a .NET MAUI app targeting .NET 9, just add a Label and bind it to a numeric value e.g. decimal and use `StringFormat='{0:c}' in the label to format it as currency.

Link to public reproduction project repository

https://github.com/iQuestLLC/maui-9-issues

No response

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Not yet

Relevant log output

@imsam67 imsam67 added the t/bug Something isn't working label Nov 28, 2024
@Ying-6
Copy link

Ying-6 commented Nov 28, 2024

Hi @imsam67 I added the label code you provided to the MainPage.xaml file, but it does not display any value after being deployed to the iOS simulator. Could you provide us with a sample project so we can investigate it further? Looking forward to your reply!

@imsam67
Copy link
Author

imsam67 commented Nov 28, 2024

@Ying-6 Here's the repo with sample code. You'll see what I'm talking about on MainPage.xaml.

https://github.com/iQuestLLC/maui-9-issues

@Ying-6
Copy link

Ying-6 commented Nov 28, 2024

This issue has been verified using Visual Studio 17.13 Preview 1(9.0.10 & 9.0.00). Can repro this issue on iOS platforms. And 8.0.100 works fine.

@Ying-6 Ying-6 added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage i/regression This issue described a confirmed regression on a currently supported version labels Nov 28, 2024
@jsuarezruiz jsuarezruiz added the area-xaml XAML, CSS, Triggers, Behaviors label Nov 28, 2024
@jfversluis
Copy link
Member

I don't think this is on us: dotnet/runtime#108958

@tj-devel709
Copy link
Member

I will close this issue for now as @jfversluis posted the root cause of this issue in the runtime repro. There is a listed workaround there for now as well. Please feel free to re-open this issue though or create a new one and link this one if needed!

@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-xaml XAML, CSS, Triggers, Behaviors i/regression This issue described a confirmed regression on a currently supported version platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants