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

ratio decimal point error #9

Open
kevin-dunas opened this issue Jan 8, 2022 · 1 comment
Open

ratio decimal point error #9

kevin-dunas opened this issue Jan 8, 2022 · 1 comment

Comments

@kevin-dunas
Copy link

kevin-dunas commented Jan 8, 2022

Hello, I am using your app well.
If you enter the ratio as a decimal point, there seems to be a bug.
If the ratio is 7.5 and 20g of coffee beans, the amount of water should be 150ml.
But in the app it comes out as 320ml.
If you have 320ml of water and 20g of coffee beans, the ratio should come out 16.
There seems to be an error in the process of handling decimal points. Can you please fix this?
IMG_0615

@edwellbrook
Copy link
Member

Hi @kevin-dunas,

Thanks for opening this issue. I would accept a pull request that fixes this.

Currently Ratios treats the "Ratio" input as an integer. You can see an example of this here:

static func calculateGrounds(brew: Double, ratio: Int) -> Double {

let ratio = self.integer(forKey: UserDefaults.ratiosPersistenceRatioKey)

let ratio = Int(self.ratioInputView.textField.text ?? "16") ?? 16

Please open a PR that changes Int to Double and I can merge and release the fix.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants