Bug 504200 - Floating point precision errors in unit converter
Summary: Floating point precision errors in unit converter
Status: CONFIRMED
Alias: None
Product: krunner
Classification: Plasma
Component: converter (other bugs)
Version First Reported In: 6.3.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-14 08:57 UTC by hendrikloewe3
Modified: 2025-05-14 16:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hendrikloewe3 2025-05-14 08:57:55 UTC
SUMMARY
When converting certain values, the unit converter in KRunner shows a rounded value in the result list, but when pressing the suggestion to copy it, it will copy a number with floating point precision errors. Either the displayed value should be copied to the clipboard or the unit converter should work with arbitrary floating point numbers instead

STEPS TO REPRODUCE
1. Open KRunner
2. Enter 5.1mm
3. Click the 0.0051m option

OBSERVED RESULT
0.0050999999999999995 is copied to the clipboard

EXPECTED RESULT
0.0051m should be copied to the clipboard.

SOFTWARE/OS VERSIONS
Operating System: Nobara Linux 42
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.5-200.nobara.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 31,3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3070
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C56
System Version: 1.0
Comment 1 Nate Graham 2025-05-14 16:41:13 UTC
Can reproduce.