# "double 2 decimal places flutter" Code Answer's

You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "double 2 decimal places flutter" answered properly. Developers are finding an appropriate answer about double 2 decimal places flutter related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like double 2 decimal places flutter. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on double 2 decimal places flutter.

### double variable into 2 decimal places flutter

By Thankful Tapir on Nov 29, 2020
``````double num1 = double.parse((12.3412).toStringAsFixed(2));
// 12.34

double num2 = double.parse((12.5668).toStringAsFixed(2));
// 12.57

double num3 = double.parse((-12.3412).toStringAsFixed(2));
// -12.34

double num4 = double.parse((-12.3456).toStringAsFixed(2));
// -12.35
``````

Source: bezkoder.com

3

### double 2 decimal places flutter

By loonix on Jan 14, 2021
``````/// Define an extension:
extension Ex on double {
double toPrecision(int n) => double.parse(toStringAsFixed(n));
}

/// Usage:
void main() {
double d = 2.3456789;
double d1 = d.toPrecision(1); // 2.3
double d2 = d.toPrecision(2); // 2.35
double d3 = d.toPrecision(3); // 2.345
}``````

Source: stackoverflow.com