String toFixed(double value, int precision) => value.toStringAsFixed(precision);
But when it is called I get this error:
Am I missing something about how the arguments to filters in the polymer.dart version of things?
Thanks,
Randy
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
{{myNumber | toFixed(myNumber, 2)}}
Filters must be a one-argument function.
{{toFixed(myNumber, 2)}}
Can you rewrite your code without "=>" ? Thanks!
class MyElement extends PolymerElement {
String toFixed(int digits) {
return (num n) {
return n.toStringAsFixed(digits);
};
}
}
OK, this is to return a function. By the way, dose Dart support parsing in a function as an argument, like C? This is a totally different question.Thanks!