Skip to content

Fix float formatting in web utils#187

Closed
cwitting wants to merge 1 commit into
emweb:masterfrom
cwitting:master
Closed

Fix float formatting in web utils#187
cwitting wants to merge 1 commit into
emweb:masterfrom
cwitting:master

Conversation

@cwitting

@cwitting cwitting commented Mar 1, 2022

Copy link
Copy Markdown

Before any negative number would be rendered as a scientific number in javascript.
I think this is more in line with the intention, which will render
numerically very small and very large numbers as scientific.

Here is an example of rendered javascript before and after
before:
ctx.moveTo(-8.6e00,-1.4e01);ctx.lineTo(8.6,-1.4e01);ctx.lineTo(8.6,14.0);ctx.lineTo(-8.6e00,14.0);ctx.lineTo(-8.6e00,-1.4e01);
after:
ctx.moveTo(-8.6,-14.0);ctx.lineTo(8.6,-14.0);ctx.lineTo(8.6,14.0);ctx.lineTo(-8.6,14.0);ctx.lineTo(-8.6,-14.0);

I think the second one is more correct.

Before any negative number would be rendered as a scientific number.
I think this is more in line with the intention, which will render
numerically very small and very large numbers as scientific.
@emweb

emweb commented Jun 23, 2022

Copy link
Copy Markdown
Collaborator

Thanks, I merged this manually.

Roel

@emweb emweb closed this Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants