Skip to content

Conversation

@alternateal
Copy link

Updated code to use significant digits to enable decimals to be shown on both watch app and complication.


func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: (@escaping (CLKComplicationTimelineEntry?) -> Void)) {

let formatter = NumberFormatter(); formatter.usesSignificantDigits = true; formatter.minimumSignificantDigits = 2; formatter.maximumSignificantDigits = 3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this display with mg/dl?

Need to avoid repeating this code three times.

@ps2
Copy link
Collaborator

ps2 commented Dec 4, 2016

Actually, I think we will be able to use @bharat 's extension to do this: b41ceda

@alternateal
Copy link
Author

Happy to use @bharat's extension (provided it works on watch also) - I knew it was quick and dirty solution - just needed to make something workable for users of mmol/L. Happy to close the thread if you want?

@ps2
Copy link
Collaborator

ps2 commented Dec 4, 2016

I would rather you keep it open and then update it to use the HKUnit unit extension when it's available!

@loudnate
Copy link
Collaborator

loudnate commented Dec 9, 2016

Once the HKUnit extension is available, include it in the watch target along with NSNumberFormatter.swift, so you can use NumberFormatter.glucoseNumberFormatter(for: HKUnit)

@ps2
Copy link
Collaborator

ps2 commented Dec 10, 2016

The HKUnit extension has been merged into dev, if you want to rebase and update this PR to use it.

@ps2
Copy link
Collaborator

ps2 commented Feb 19, 2017

I believe this is resolved properly with #379

@ps2 ps2 closed this Feb 19, 2017
ps2 pushed a commit that referenced this pull request Nov 16, 2020
… flag (#303)

* set insulin delivery log header label colour

* blocking entry deletion with existing flag
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.

3 participants