This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 1.0.1
Provide format string functionality.
version 1.0.2
license MIT
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.2
Committed At 2016-12-30 20:41:36 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

Modules

README

String format for Elm

This is a very simple implementation of format strings for Elm.

Usage

There is a different format function based on the number of place holders in the format string up to 9. So format1, format2, ..., format9.

To substitute 1 value

format1 "Value: {1}" 1
-- Will result in the string "Value: 1"

More than one value is passed using a tuple.

let
  x = 1
  y = "2nd"
  z = 3.3
in
  format3 "Val 1: {1}, Val 2: {2}, Val 3: {3}" (x, y, z)
-- Will result in the string "Val 1: 1, Val 2: 2nd, Val 3: 3.3"

Underneath toString is being called for the values. Please view the tests for more examples.