yanick/Template-Mustache

String Scalars are Rendered as Numbers in Scientific Notation

atancasis opened this issue · 3 comments

There doesn't appear to be a way to force a given scalar to be rendered in string context, as illustrated:

❯ perl -MTemplate::Mustache -E 'say Template::Mustache->render("{{.}}", "123456789012345678901")'
1.23456789012346e+20

❯ perl -MTemplate::Mustache -E 'say Template::Mustache->render("{{.}}", 123456789012345678901)'
1.23456789012346e+20

❯ perl -MTemplate::Mustache -E 'say $Template::Mustache::VERSION'
1.3.2

❯ perl -v | grep version
This is perl 5, version 28, subversion 0 (v5.28.0) built for darwin-2level

I tried an alternative module, Mustache::Simple which appears to be handling this correctly, but thought I should provide this feedback.

Please don't hesitate to let me know if there's any additional information that I can provide. Thanks!

Good find! Fixed and pushed to CPAN. thanks!

thanks a BUNCH @yanick for the very quick turnaround, much appreciated!

My pleasure. Thanks to the specifics, it was easy to reproduce, root, and ultimately fix. :-)

Enjoy!