Skip to content

Instantly share code, notes, and snippets.

@fcontreras
Created August 25, 2020 21:05
Show Gist options
  • Save fcontreras/d5095da7daa0ce24e0f3cb157b91e97f to your computer and use it in GitHub Desktop.
Save fcontreras/d5095da7daa0ce24e0f3cb157b91e97f to your computer and use it in GitHub Desktop.
Adding toDouble to Strings
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