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

Update StatUtils.ts for number formatting + Format numbers used in views #2

Merged
merged 2 commits into from
Jul 25, 2024

Conversation

NullCub3
Copy link
Owner

From: lukeleppan#114

I wrote a new function (formatNumber) that removes floating point errors and adds thousands separators to a number, and applied this function to the results of most numeric variables sent to StatusBar.ts

At the very least, this hopefully resolves lukeleppan#103 and resolves lukeleppan#111

FYI: I haven't tested this change myself in Obsidian, so I may have missed something.

And: DrYoshiyahu#1

Builds on @.DrYoshiyahu formatting to always present formatted numbers, and in one case preserving the number where it is used for calculations (but not shown to user). Addresses lukeleppan#103 and lukeleppan#111

This is not the best organization/naming, but it compiles and works as expected.

Screenshot showing Total Pages (tp) and Words per Day (wpd) that are properly rounded. Screenshot 2024-02-13 at 8 23 53 AM

Screenshot showing Current Pages (p) and Total Pages (ppd) that are properly rounded. Screenshot 2024-02-13 at 8 23 43 AM

DrYoshiyahu and others added 2 commits November 20, 2023 20:00
Wrote a new function (formatNumber) that removes floating point errors and adds thousands separators to a number, and applied this function to the results of most numeric variables sent to StatusBar.ts
@NullCub3 NullCub3 merged commit 097aee6 into NullCub3:number-formatting Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants