Created
April 24, 2015 08:24
-
-
Save tomajask/245c9dc7d60875f69718 to your computer and use it in GitHub Desktop.
sample gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float = 123.45678 | |
"%.4f" % float | |
# => "123.4568" | |
# or you can write it in a little bit different way | |
sprintf "%.4f", float | |
# => "123.4568" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment