-
Notifications
You must be signed in to change notification settings - Fork 14
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
toString functions? #20
Comments
I agree this is important, but I also think that it is probably sufficiently interesting to go into a separate package ( |
Well, I agree that it is a significant amount of complexity that is slightly orthogonal to the package as it is. But as a user I think I'd quite like to have some of that formatting right at my fingertips and not necessarily have to find out about another package then install it, etc. On the i18n front, I feel like that's a topic that the Elm community doesn't really have a great solution to yet. There are plenty of options, but none of them feel just right to me (and most of these are oriented towards applications rather than packages). So not sure what to recommend on that front. |
Actually I was reading a bit about the Intl api: Seems like they solve a decent number of the formatting issues. |
Read through a bit, that does look like a useful reference! I still think it will take a few tries to get an API that works well, though, so my preference would still be to start by adding this to something like an |
Yes of course. What I was also suggesting with my previous comment, was that when Elm does get official Intl bindings, then it might be best to tackle this, as making internationalised packages is quite annoying without it. |
I think there is an interesting challenge related to elm-units, which is how to format them for human consumption.
For example,
could be shown as:
12 km
12,000.3 m
7.46 miles
I assume that a formatter for length would like to know the precision and whether to prefer imperial or SI units.
Other units have similar issues.
Angle is interesting, since it is formatted like this often:
123º 12' 32"
I don't know if there are significant internationalization challenges here (except perhaps duration), but worth thinking about.
The text was updated successfully, but these errors were encountered: