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

Question: Support localize converting ? #93

Closed
ahnpnl opened this issue Feb 2, 2018 · 5 comments
Closed

Question: Support localize converting ? #93

ahnpnl opened this issue Feb 2, 2018 · 5 comments

Comments

@ahnpnl
Copy link

ahnpnl commented Feb 2, 2018

Hi,

I checked the document of filesize.js about converting to localized number but I couldn't find any options. Does filesize.js support converting to localized number ? For example in UK they use dot as decimal separator while some other countries they use comma

@avoidwork
Copy link
Owner

Hi,

At this time it does not. If I were to add that, it would probably just be specifying a delimiter (default would be ""). How does that sound?

@avoidwork
Copy link
Owner

Follow up question, if your formatting with a period, how do you know what's the decimal place?

@ahnpnl
Copy link
Author

ahnpnl commented Feb 3, 2018

Hi,
I think providing an option to specify the delimiter sounds good. What I have in mind is after your library finishes the part of calculating the number, taking the option delimiter which the user passes in and use it to replace your comma. What do you think ? I don't know if the calculation needs to take into account of thousand separator as well or not

@avoidwork
Copy link
Owner

oic, i misunderstood; shouldn't be a problem landing this.

@ahnpnl
Copy link
Author

ahnpnl commented Feb 3, 2018

Perhaps providing an optional thousand separator input and also an optional decimal separator input looks better for me :) We don't know who wants to have thousand separator in their codes even though I don't see that case that often

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