quietgarden/elm-web3-ui/2.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/quietgarden/elm-web3-ui is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 2.0.0 found (1 same-name repos checked); no cached copy. Use another version.

Details

Web3.Ui.PriceDisplay

Token price display with automatic notation selection.

Bonding curve prices span many orders of magnitude. This module picks the most readable notation automatically so each project does not reimplement the same range-checking logic.

Web3.Ui.PriceDisplay.view []
    { decimals = 18, symbol = "PLS" }
    priceWei


Web3.Ui.PriceDisplay.format 18 priceWei
--> "0.00042"   (fixed for normal range)
--> "1.23M"     (SI suffix for large)
--> "4.56e-10"  (scientific for tiny)
List (Attribute msg)
-> { decimals : Int
, symbol : String
}
-> BigInt
-> Html msg

Display a token price, automatically selecting notation.

Notation rules:

  • ≥ 1 000: SI suffix (1.23M, 45.6K)
  • 0.001 – 999.99: fixed decimal (1.23, 0.456, 0.00123)
  • < 0.001: scientific (4.56e-10)

CSS class: web3-price

format : Int -> BigInt -> String

Format a price BigInt as a human-readable string. No symbol appended.

See view for notation selection rules.