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

Percent format specifier is not implemented #5

Closed
Atrejoe opened this issue Jun 20, 2019 · 2 comments
Closed

Percent format specifier is not implemented #5

Atrejoe opened this issue Jun 20, 2019 · 2 comments

Comments

@Atrejoe
Copy link

Atrejoe commented Jun 20, 2019

Initially logged at wrong repo at: dmester/sffjs#8

It appears that the percent format specifier is not implemented:

See specifications:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#the-percent-p-format-specifier

What it should do:

var value = 1.912421m;

$"{value:p}".Dump();
$"{value:p0}".Dump();
$"{value:p10}".Dump();

values:

191,24%
191%
191,2421000000%

What it does:

Values are not multiplied by 100

1,91%
2%
1,9124210000%

Workaround

Use custom format string %
#.## % instead of p2

@thorn0 thorn0 closed this as completed in 565c870 Jun 20, 2019
@thorn0
Copy link
Owner

thorn0 commented Jun 20, 2019

Can't reproduce. See https://jsbin.com/cidotahimi/edit?html,js,output

@Atrejoe
Copy link
Author

Atrejoe commented Jun 20, 2019

Thanks, I will have to investigate further what version (and what exact package we are using)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants