-
Notifications
You must be signed in to change notification settings - Fork 159
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
Number to Text conversion #218
Comments
+1 very confusing not having the fastest solution as part of the Text package. Please consider adding or directing readers of documentation in the right direction. |
Agree. I think there is no debate there should be a fast function to convert: There is: text-builder where is |
Is this request under consideration? I was surprised to find that this does not exist yet. |
Float-to-string conversion is hard. Once haskell/bytestring#365 lands into |
@Bodigrim Currently, the haskell/bytestring#365 has been pulled but, I have recently updated the float to string implementation in bytestring and have greatly improved its performance and added some capabilities. However, I have not made any breaking changes to the interface and integration to text can begin now. The performance and organization PRs currently submitted
New formatting options Also, the Ryu algorithm may not print floating point numbers the same as your current implementation since it minimizes the the number of digits printed. I have not looked at the text implementation so this may not be an issue. |
Thanks @BebeSparkelSparkel. I'm severely overloaded at the moment, but I'm sure @clyring will review your PRs for A PR migrating |
I think it's time we add intToText :: Integral a => a -> T.Text
intToText = T.toStrict . B.toLazyText . B.decimal because this incantation is so arcane that the vast majority of users succumb to I'm unsure about the name. It should mention that it's a decimal representation, not hexadecimal. Maybe simply |
Hi,
may I suggest adding conversion functions such as
to
Data.Text
because I spent now around two hours in finding a way to convert numbers to Text objects. Maybe there is a better way, in that case it would be nice to have it documented in the main file of the module.Thank you!
The text was updated successfully, but these errors were encountered: