Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double decimal point in generate rounding explanation #5

Open
mole6e23 opened this issue Aug 28, 2023 · 0 comments
Open

Double decimal point in generate rounding explanation #5

mole6e23 opened this issue Aug 28, 2023 · 0 comments
Assignees

Comments

@mole6e23
Copy link

mole6e23 commented Aug 28, 2023

In the example code shown below, with the Macro version from August 22, 2023, generating the rounding explanation for the value 389.78582 to three significant figures generates an incorrect explanation with a double decimal point. See attached screen shot.

I was able to fix this by changing contextInexactValue lines 1240 and 1242 from:

$firstDigitToDrop = substr($trimmedData, $ind, 1); $ind++; $restToDrop = substr($trimmedData, $ind, length($trimmedData) - $ind);
to

$firstDigitToDrop = substr($decimalRemoved, $ind, 1); $ind++; $restToDrop = substr($decimalRemoved, $ind, length($decimalRemoved) - $ind);

The change was using $decimalRemoved instead of $trimmedData. I have not tested this change widely, but it seemed to fix the current issue.

Sample code is attached.

Screen Shot 2023-08-28 at 8 41 03 AM
SigFigDescriptionError.txt

@limefrogyank limefrogyank self-assigned this Sep 2, 2023
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

No branches or pull requests

2 participants