Verse Library verse

01 Snippet

Implements a scientific notation big number type with arithmetic, comparisons, and formatted string output for game economics.

extracted-snippets/community/snippets/DdvN/fortnite-big-numbers-module-with-test-cases-demo-device-based-on-celeryman-s-module/01-snippet.verse

# Source URL: https://dev.epicgames.com/community/snippets/DdvN/fortnite-big-numbers-module-with-test-cases-demo-device-based-on-celeryman-s-module
# Local doc:  epic-docs/community/snippets/DdvN/fortnite-big-numbers-module-with-test-cases-demo-device-based-on-celeryman-s-module.md
  # ===============================================================================
  # BigNum Module - Scientific Notation Big Number Implementation
  # ===============================================================================
  #
  # Author: VukeFN
  #
  # Based on the original work by CeleryMan from Epic Games Community Forums:
  # https://dev.epicgames.com/community/snippets/wpbL/fortnite-functions-to-work-with-ridiculously-big-numbers
  #
  # Extended and enhanced with additional features including:
  # - Enhanced error handling and edge case management
  # - Comprehensive comparison operators with abbreviated forms
  # - Improved string formatting with negative number support
  # - Robust normalization functions for display formatting
  # - Comprehensive documentation and code organization
  #
  # This module provides a big number system using scientific notation representation.
  # Numbers are stored as Value × 10^Exponent where Value is typically 1.0-9.999...
  #
  # Features:
  # - Arithmetic operations (+, -, *, /)
  # - Comparison operations (=, ≠, <, >, ≤, ≥)
  # - String formatting with K/M/B/T suffixes
  # - Game utility functions for cost calculations
  # - Support for very large numbers (up to ~10^308)
  #
  # Examples:
  # - 1,500 = big_number{Value := 1.5, Exponent := 3}

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in