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

Add number format function #7166

Merged
merged 29 commits into from
Oct 31, 2024
Merged

Conversation

Efnilite
Copy link
Member

Description

Continues #4663.

  • Format now depends on whether passed value is a decimal or whole number. Previously, this would round decimal numbers down to integers, which may be unexpected behaviour for people who want to format decimal numbers as decimals.
    • formatNumber(123456) -> 123,456
    • formatNumber(123456.7890) -> 123,456.79
  • Improved tests with none, NaN, infinity, floats

Thanks @AyhamAl-Ali!


Target Minecraft Versions: any
Requirements: none
Related Issues: none

AyhamAl-Ali and others added 28 commits March 15, 2022 15:56
Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com>
Co-authored-by: LimeGlass <16087552+TheLimeGlass@users.noreply.github.com>
…number

# Conflicts:
#	src/main/java/ch/njol/skript/classes/data/DefaultFunctions.java
@Efnilite Efnilite added the feature Pull request adding a new feature. label Oct 28, 2024
@Moderocky Moderocky added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Oct 29, 2024
@sovdeeth sovdeeth merged commit 9786eb4 into SkriptLang:dev/feature Oct 31, 2024
5 checks passed
@Efnilite Efnilite deleted the formatted-number branch October 31, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull request adding a new feature. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants