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

Fix sliders for whole numbers #834

Merged
merged 1 commit into from
Dec 16, 2017
Merged

Fix sliders for whole numbers #834

merged 1 commit into from
Dec 16, 2017

Conversation

PabstMirror
Copy link
Contributor

[3.14, 1, -2] call cba_fnc_formatNumber = "003"
Could also fix in formatNumber?
Or we could switch to toFixed (3.14 toFixed -1 = "3")

@commy2
Copy link
Contributor

commy2 commented Dec 15, 2017

-2 meaning 3 forced digits with leading zeros is intended by CBA_fnc_format.
Why does the setting use _trailingDecimals = -2 in the first place?

@PabstMirror
Copy link
Contributor Author

From #510

FormatNumber:

_decimalPlaces - Number of decimal places, padded with trailing 0s,
        if necessary [Number: >= 0, defaults to 0]

I guess the call would be [3.14, 1, -1] call cba_fnc_formatNumber but that's also "003"

@commy2
Copy link
Contributor

commy2 commented Dec 15, 2017

Is the -1 supposed to be "ignore this"?

[3.14, 1, -1] call cba_fnc_formatNumber [is] also "003"

That's a bug then.

@PabstMirror
Copy link
Contributor Author

-1 is for whole numbers only,
but passing -1 to format number is undefined, not really an error

I think we should just do the _trailingDecimals max 0 as that fixes the output

@commy2
Copy link
Contributor

commy2 commented Dec 15, 2017

-1 is for whole numbers only,

But that is already what 0 does. Zero places after the decimal dot.

@PabstMirror
Copy link
Contributor Author

See #510
0 doesn't display decimal places, but they still exist in the final setting.

@commy2
Copy link
Contributor

commy2 commented Dec 15, 2017

I get it now.

@commy2 commy2 added this to the 3.6.0 milestone Dec 15, 2017
@commy2 commy2 merged commit 8278650 into master Dec 16, 2017
@commy2 commy2 deleted the fixWholeNumberDisplay branch December 16, 2017 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants