Created
August 25, 2020 21:05
-
-
Save fcontreras/d5095da7daa0ce24e0f3cb157b91e97f to your computer and use it in GitHub Desktop.
Adding toDouble to Strings
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
void main() { | |
var value = "20.0".toDouble(); | |
print(value.toString()); | |
} | |
extension NumberParsing on String { | |
double toDouble() { | |
return double.parse(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment