Module: utils/formatUtil

Formatting Utility for Satoshi Showdown. This module provides functions for standardizing and formatting data across the application, such as dates, currencies, and other domain-specific data. It ensures consistency and readability, enhancing the user experience and data handling.

Source:

Requires

  • module:luxon

Methods

(inner) formatCryptoAddress(address) → {string}

Placeholder function for formatting cryptocurrency addresses. Can be implemented to format addresses according to specific requirements.

Parameters:
Name Type Description
address string

The cryptocurrency address to format.

Source:
Returns:

The formatted cryptocurrency address.

Type
string

(inner) formatCurrency(amount, currencyopt) → {string}

Formats a numeric amount into a currency string.

Parameters:
Name Type Attributes Default Description
amount number

The numeric amount to format.

currency string <optional>
"USD"

The currency code to format the amount in (e.g., "USD").

Source:
Returns:

The formatted currency string.

Type
string

(inner) formatDate(date, formatStropt) → {string}

Formats a JavaScript Date object into a specified string format using Luxon.

Parameters:
Name Type Attributes Default Description
date Date

The date object to format.

formatStr string <optional>
"yyyy-MM-dd HH:mm:ss"

The string format to use for the output.

Source:
Returns:

The formatted date string.

Type
string