The PDF 1.3 Reference Manual says (4.3 numbers, page 37):
Exponential format for numbers (such as 1.0E3) is not supported.
fix for issues #67 and #35
Fix transformation issues. Closes #67, #68 and #35.
I think 5 decimal places is probably enough.
Thanks for looking to this. I implemented something similar in 2e457ac. I think 5 decimal places is probably enough. :)
Hi Devon, I'm glad to contribute to this awesome module.
You patch is shorter, yes, but it adds to 0 and any integer a ~useless .00000 , mine takes care to do that only for numbers < 1 and > -1, and to print zeros as 0 not as 0.00000 ... :-)
Also, note that it's not only transform who writes reals, this conversion from exponential to fixed should be done anywhere a real is written to the .pdf.
Ah but mine does as well! That's what the + is for in +v.toFixed(5). First it generates a string rounded to 5 decimal places and including extra 0s but the + converts it back to a number, which discards the extra 0s. Try it: (0).toFixed(5) evaluates to "0.00000" but +(0).toFixed(5) evaluates to just 0.
As for the rest of the PDF, I don't think there is anywhere else that exponential notation would reasonably be used so just doing this for transforms seems fine to me.