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

🚑 add a prop 'decimalPlaces' for more flexible use #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qinhua
Copy link

@qinhua qinhua commented May 23, 2021

@xlsdg
Add a prop 'decimalPlaces' for more flexible use.

Just fixed the issue #28 'Decimal places property missing'.

Decimal places property missing #28
What happened to the decimals property? In a much earlier version there was a property that allowed for setting the decimal places. Now it's being ignored and I see no reference to it in the docs.

Cause I encountered this scene, too.
But the original property must place in the config, a little bit inflexible when configurate more than one instance.

The modifications are as follows:
decimalPlaces: {
type: Number,
required: ##false,
default: 0,
}

const config = that.decimalPlaces ?
Object.assign({}, that.options, {
decimalPlaces: that.decimalPlaces,
}) :
that.options;

const instance = new CountUp(
dom,
that.endVal,
config
);

@steveDL
Copy link

steveDL commented Nov 4, 2021

Is this going to be merged in soon I need to use decimals?

@qinhua
Copy link
Author

qinhua commented Nov 4, 2021

@xlsdg Please check this code

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