Fix: Add rounding for big number display (Issue #187)#191
Conversation
✅ Deploy Preview for radiant-cucurucho-d09bae ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@Natkuma01 - this looks great, but could you make a separate function for the rounding and put it into |
|
Also @Natkuma01 how did you hear about this project? I'm surprised to get a random contributor, but we definitely appreciate the help! 🎉 |
|
Hi @vkoves, sorry if this is a little awkward. I'm a CS college student. I found your issues on https://goodfirstissues.com/. Your project has a tag of "good first issue" and I'm new to open source projects; your issue seems like a good start and practice for me. I refactored the code , add a function in common-functions.vue I’m totally open to revisiting or refining the code as many times as needed. I have whole semester 🤗 |
vkoves
left a comment
There was a problem hiding this comment.
This looks great, thank you for the contribution!
| /** | ||
| * Rounds a number to whole number if it is greater than 1000, | ||
| * otherwise returns the original number | ||
| * This function always returns a NUMBER |
There was a problem hiding this comment.
Small optional note, this comment is unnecessary because of the typing - since the function has the number return type, we know that it isn't returning a string.
|
The linting is failing (I had to approve it running), but since this is a fork I'm just going to merge and I'll run |

Description
Add a floor function with the condition that if the value is greater than 1000, round it up to a whole number; if it is less than 1000, do not make any changes.
Fixes #
Issue #187
#Before Fix

The values for District Steam Use and District Chilled Water Use are displayed with one decimal place, even if the number greater 1000.
#After Fix

Changes Made
on HistoricalBuildingDataTable.vue

I noticed there are comments mentioning the need to round and process an optional float to a locale string, so I added that to the code. However, this refers to the Table, so please delete my code if this is not an issue.
on StatTile.vue

This fixed the issue for the number format under District Steam Use and District Chilled Water Use
This is my first time making an open-source contribution. I'm happy to learn more if any part of this format is incorrect.