Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-murphy committed Sep 23, 2023
1 parent da7b0a1 commit bf83362
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spago install js-intl

Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-js-intl).

See also: the official specification published [here](https://tc39.es/ecma402/), MDN documentation [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl).
See also: the ECMA-402 specification published [here](https://tc39.es/ecma402/), MDN documentation for `Intl` [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl).

## How to use this library

Expand All @@ -44,7 +44,6 @@ import JS.Intl.NumberFormat as NumberFormat
import JS.Intl.Options.Notation as Notation
import JS.Intl.Options.NumberFormatStyle as NumberFormatStyle
import JS.Intl.Options.PluralCategory (PluralCategory(..))
import JS.Intl.Options.PluralCategory as PluralCategory
import JS.Intl.Options.UnitDisplay as UnitDisplay
import JS.Intl.PluralRules as PluralRules
import JS.Intl.Segmenter as Segmenter
Expand Down Expand Up @@ -183,13 +182,13 @@ constructors.
pluralRules <- PluralRules.new [ en_US ] { type: "ordinal" }
let
numbers = [ 1, 2, 3, 81, 138 ]
numbers = [ 1, 2, 3, 8, 21 ]
formattedOrdinals = numbers <#> \number -> do
let
suffix = ordinalSuffix (PluralRules.select pluralRules number)
show number <> suffix
Console.logShow formattedOrdinals -- ["1st","2nd","3rd","81st","138th"]
Console.logShow formattedOrdinals -- ["1st","2nd","3rd","8th","21st"]
```

### Type safety and overloaded API
Expand Down
5 changes: 2 additions & 3 deletions example/Example.purs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import JS.Intl.NumberFormat as NumberFormat
import JS.Intl.Options.Notation as Notation
import JS.Intl.Options.NumberFormatStyle as NumberFormatStyle
import JS.Intl.Options.PluralCategory (PluralCategory(..))
import JS.Intl.Options.PluralCategory as PluralCategory
import JS.Intl.Options.UnitDisplay as UnitDisplay
import JS.Intl.PluralRules as PluralRules
import JS.Intl.Segmenter as Segmenter
Expand Down Expand Up @@ -141,13 +140,13 @@ main = do
pluralRules <- PluralRules.new [ en_US ] { type: "ordinal" }

let
numbers = [ 1, 2, 3, 81, 138 ]
numbers = [ 1, 2, 3, 8, 21 ]
formattedOrdinals = numbers <#> \number -> do
let
suffix = ordinalSuffix (PluralRules.select pluralRules number)
show number <> suffix

Console.logShow formattedOrdinals -- ["1st","2nd","3rd","81st","138th"]
Console.logShow formattedOrdinals -- ["1st","2nd","3rd","8th","21st"]
--
-- ### Type safety and overloaded API
--
Expand Down
2 changes: 1 addition & 1 deletion example/README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spago install js-intl

Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-js-intl).

See also: the official specification published [here](https://tc39.es/ecma402/), MDN documentation [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl).
See also: the ECMA-402 specification published [here](https://tc39.es/ecma402/), MDN documentation for `Intl` [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl).

## How to use this library

Expand Down

0 comments on commit bf83362

Please sign in to comment.