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

[blockly] Add new math_round block with round up, down and by decimals #1871

Merged
merged 3 commits into from
May 6, 2023

Conversation

stefan-hoehn
Copy link
Contributor

@stefan-hoehn stefan-hoehn commented May 1, 2023

Fixes #1303.

Replaces the original Math-Round block with a new one that adds rounding by given decimals.
Block adds an additional field to enter the decimals for the fourth mode

image

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
@stefan-hoehn stefan-hoehn requested a review from a team as a code owner May 1, 2023 19:45
@relativeci
Copy link

relativeci bot commented May 1, 2023

Job #961: Bundle Size — 15.75MiB (+0.01%).

b94028e(current) vs 8738fce main#960(baseline)

⚠️ Bundle contains 16 duplicate packages

Metrics (1 change)
                 Current
Job #961
     Baseline
Job #960
Initial JS 1.73MiB 1.73MiB
Initial CSS 608.85KiB 608.85KiB
Cache Invalidation 93.94% 93.9%
Chunks 219 219
Assets 689 689
Modules 1717 1717
Duplicate Modules 85 85
Duplicate Code 1.73% 1.73%
Packages 137 137
Duplicate Packages 15 15
Total size by type (2 changes)
                 Current
Job #961
     Baseline
Job #960
CSS 858.58KiB 858.58KiB
Fonts 526.1KiB 526.1KiB
HTML 1.23KiB 1.23KiB
IMG 140.74KiB 140.74KiB
JS 9.24MiB (+0.01%) 9.24MiB
Media 295.6KiB 295.6KiB
Other 4.73MiB (+0.01%) 4.73MiB

View job #961 reportView main branch activity

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

I have added a default value for the decimals by doing some Blockly magic and I updated the label for round by decimals because the arrow looked awfully on my system.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels May 6, 2023
@florian-h05 florian-h05 added this to the 4.0 milestone May 6, 2023
@florian-h05 florian-h05 changed the title [blockly] add new mutating math-round block with toFixed [blockly] Add new math_round block with round up, down and by decimals May 6, 2023
@florian-h05 florian-h05 merged commit fa37199 into openhab:main May 6, 2023
@florian-h05 florian-h05 deleted the blockly_math_round branch May 6, 2023 23:09
@stefan-hoehn
Copy link
Contributor Author

Final solution
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[blockly] Enhance 'round' block to allow setting decimal places
2 participants