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

tabulated input fields do not adapt to unit fraction #1

Open
hwjeremy opened this issue Apr 26, 2019 · 0 comments
Open

tabulated input fields do not adapt to unit fraction #1

hwjeremy opened this issue Apr 26, 2019 · 0 comments
Assignees
Labels
bug Something isn't working pending new feature requires addition of new functionality to be resolved

Comments

@hwjeremy
Copy link
Collaborator

Global and Custom units may have arbitrary minimum fractions. For example a U.S. Dollar's smallest fraction is cents (two fractional digits) while a Bitcoin might have a Satoshi as its smallest fraction (six fractional digits). While the Amatino API fully supports such arbitrary fractions, Amatino Mac is currently hard-coded with two fractional digits. For example, in TabularAmountInput:

init(
        frame frameRect: NSRect,
        side: Side
) {
        self.side = side
        super.init(frame: frameRect)
        numberFormatter.locale = Locale.current
        numberFormatter.numberStyle = .decimal
        numberFormatter.currencySymbol = nil
        numberFormatter.minimumIntegerDigits = 1
        numberFormatter.minimumFractionDigits = 2 // <- bad!
        numberFormatter.maximumFractionDigits = 2 // <- bad!

//...

To resolve this issue, various input classes will need to be able to receive and adapt to supplied Global and Custom unit fractional digit sizes.

@hwjeremy hwjeremy added bug Something isn't working pending new feature requires addition of new functionality to be resolved labels Apr 26, 2019
@hwjeremy hwjeremy self-assigned this Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending new feature requires addition of new functionality to be resolved
Projects
None yet
Development

No branches or pull requests

1 participant