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

numfmt #2058

Open
sunnyawake5 opened this issue Dec 29, 2024 · 2 comments
Open

numfmt #2058

sunnyawake5 opened this issue Dec 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@sunnyawake5
Copy link

sunnyawake5 commented Dec 29, 2024

with custom numfmt "[$¥-8004]" "#" "####""", the value "80145.899999999994" format to "80145.899999999994", but excel format as "¥ 8 0146"。

after the following change, the result is correct:
in numfmt.go:
supportedLanguageCodeInfo={
"8004":xxx,
xxx
}
in printNumberLiteral func:
...
if token.TType == nfp.TokenTypeHashPlaceHolder || token.TType == nfp.TokenTypeZeroPlaceHolder {
if useLiteral && usePlaceHolder {
//change here
//return nf.value
return result
}
...

@sunnyawake5
Copy link
Author

sunnyawake5 commented Dec 29, 2024

another problem:
custom numFmt:"General"
value:0.0140760821860323
formatted to 0.01407608219
excel format to 0.014076082

@xuri
Copy link
Member

xuri commented Dec 30, 2024

Thanks for your issue. As the documentation of GetCellValue says: "If the cell format can be applied to the value of a cell, the applied value will be returned, otherwise the original value will be returned", this library doesn't support apply all kinds of number format, if the number format doesn't support will be fallback to original value. Contribution are welcome.

@xuri xuri added the enhancement New feature or request label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants