Closed dtpxl closed 5 years ago
Oh man; I'm not sure how to handle this yet. I hadn't even realized until reading this PR that MFP properly localized measurements like that. Let me do a little thinking.
Thanks for your original report so long ago, @dtpxl -- I've finally resolved this, albeit in a slightly different way. Have a look at https://github.com/coddingtonbear/python-myfitnesspal/commit/d539e19c58e3c5d7391462f3f7e5656554bf41e7 if you're super curious.
Cheers, and really sorry for the terrible delay on this one!
This is awesome, many thanks for that! And yeah that's much better than the quick hack I submitted. Cheers again!
Hey there
Ignoring the fact that the UK stone/pound measurement is weird, they show up on the measurements page as (for example) '12 st 3 lbs'. _get_numeric() currently transforms this to '123.0'. This means there's no way to cleanly differentiate the two units without hacky logic in the client app (which gets particularly messy if a measurement is sub 10 stone.)
This is a quick and dirty stab at it, I put it in the call to _get_numeric() rather than _get_numeric() itself to reduce the risk of breaking any of the other callers.