deefrawley / Flow.Launcher.Plugin.GenConvert

General weights and measures converter plugin for Flow Launcher
Other
7 stars 2 forks source link

Rounding issue in certain scenarios #24

Open Sneakpeakcss opened 11 months ago

Sneakpeakcss commented 11 months ago

https://github.com/deefrawley/Flow.Launcher.Plugin.GenConvert/assets/77424331/cad606f0-4180-4e2e-a688-be5e5f851820

While lb -> g is quite precise, the opposite g -> lb has its issues where anything below 227 g calculates as 0, additionally rounding in this case results in not very good precision.

I haven't tested or encountered any other 'wrong' conversions, but it's possible that it behaves similary in other scenarios.

deefrawley commented 11 months ago

What version of the plugin are you running? Looks like an older one. You should be on v2.0.1

Sneakpeakcss commented 11 months ago

What version of the plugin are you running? Looks like an older one. You should be on v2.0.1

That's exactly the one i'm using, also no additional updates are shown in FlowLauncher.

deefrawley commented 11 months ago

Not sure what is happening as I can't replicate the problem.

image

Could you try uninstalling and reinstalling the plugin?

Sneakpeakcss commented 11 months ago

image Even before that i've compared and even replaced the files with current release from repo, but unfortunately even Flow uninstall/install didn't change a thing and there's nothing in its log file beside the default initialization INFO.

I wonder if this has something to do with the same issue that happens in Color plugin though.

WIN10 22H2 FlowLauncher: 1.16.2 General Converter: 2.0.1 2023-10-14.txt

Sneakpeakcss commented 11 months ago

I wonder if this has something to do with the same issue that happens in Color plugin though.

image

Yea, exactly that.

deefrawley commented 11 months ago

I'm not sure if that's a Flow core code issue or an individual plugin issue. Do other plugins work ok? I'll keep an eye on that color issue and see if anything comes up I can fix here.

Sneakpeakcss commented 11 months ago

Other than that, everything works without any issues. However, i can't say that i use any other plugins that would require commas or decimals. If you can think of any that work in a similar way then i can check them for any weird behaviour regarding that.

If anything, i'm surprised that this plugin didn't crash like it happens with colors. And while i have no idea how it works internally, it seems a bit odd that two different plugins, written in two different languages, are having the same problem with "Regional Format" when it's not set to english, so at this point betting on Flow being the culprit seems reasonable.

Sneakpeakcss commented 9 months ago

As a workaround it looks like changing

- locale.setlocale(locale.LC_NUMERIC, "")
+ locale.setlocale(locale.LC_NUMERIC, "en_US.utf8")

works without any issues (for now) and doesn't force me to change Regional Format in Windows.

Gurrrra commented 7 months ago

I just installed Flow together with General Converter and Currency Converter and both of the round most of the stuff. Can't really see a pattern which does gets round and what doesn't, but I'd say 75% of my results gets rounded.

And btw, having "weight" or whatever is being converted in large and the result in small feels like the wrong way round :)

skosara commented 7 months ago

Hi, I have the same problem, trying to convert 5 ft to m I get 2 meters which is not correct, when i try 2 m ft I get 7 meters which also is not correct. I am using the version 2.0.1

RePacked commented 2 months ago

As a workaround it looks like changing

- locale.setlocale(locale.LC_NUMERIC, "")
+ locale.setlocale(locale.LC_NUMERIC, "en_US.utf8")

works without any issues (for now) and doesn't force me to change Regional Format in Windows.

Thanks, this fixed the issue for me as well.

deefrawley commented 2 months ago

Hi, I have the same problem, trying to convert 5 ft to m I get 2 meters which is not correct, when i try 2 m ft I get 7 meters which also is not correct. I am using the version 2.0.1

I can't replicate. Are you using a different regional format like others above? Minimum precision should be 3 decimal places.

image

image