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

FEAT: cents() and dollars() methods should optionally allow setting #386

Open
Soviut opened this issue Apr 20, 2022 · 3 comments
Open

FEAT: cents() and dollars() methods should optionally allow setting #386

Soviut opened this issue Apr 20, 2022 · 3 comments

Comments

@Soviut
Copy link

Soviut commented Apr 20, 2022

It would be handy if the cents() and dollars() methods had an optional argument so they can be used to set their respective components.

currency(25).cents(50).dollars(20)
// returns: 20.50
@raldred
Copy link

raldred commented Jan 20, 2023

Wouldn't it be better to steer towards international/generic naming

eg.

currency(25).major(50).minor(20)
// returns: 20.50

@Soviut
Copy link
Author

Soviut commented Jan 21, 2023

@raldred There are already .cents() and .dollars() methods that return their respective amounts. I was suggesting they be given an optional argument so you could use them to set the values. I'm suggesting an extension to something that's already there.

@raldred
Copy link

raldred commented Feb 24, 2023

Yeh fair enough, sorry for hijacking.

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