code_builder icon indicating copy to clipboard operation
code_builder copied to clipboard

Impossible to force literalNum(10.0) to be a double

Open m0nac0 opened this issue 4 years ago • 0 comments

If I use literalNum(10.0), the result will be 10. But I need to make sure the result is a double, i.e. has at least one decimal digit. Is there any way to achieve that? If not, maybe something like this: Expression literalDouble(double value) => LiteralExpression._(value.toString()); could be added to literal.dart? If I understand the docs for double.toString() correctly, that should ensure that at least one decimal digit is included in the output. Thank you!

m0nac0 avatar Nov 05 '21 19:11 m0nac0