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

String comparisons #24

Open
jacobweber opened this issue Apr 8, 2011 · 2 comments
Open

String comparisons #24

jacobweber opened this issue Apr 8, 2011 · 2 comments

Comments

@jacobweber
Copy link

I love this guide -- I'm going to send it to the rest of my development team. One thing I think is missing is some information on comparing floats by converting them to strings. This is often the easiest way to test for equality, when you're only concerned with how the numbers will be displayed. You can just format both numbers to the number of decimal places that you'll be displaying (e.g. using sprintf), and compare the strings.

@hamirmahal
Copy link

Huh, that's a really interesting idea.

@hamirmahal
Copy link

It might be useful to have a section comparing the benefits and trade-offs of this approach with the approaches currently in the repository.

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