Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages