Small updates
This commit is contained in:
parent
ad72fdeb0b
commit
c50e512184
10
README.md
10
README.md
@ -3,11 +3,11 @@ Nombres
|
||||
|
||||
Convert ints into french.
|
||||
|
||||
Some references:
|
||||
Provided as a 1-function library, and a basic command-line utility (`nbr` — will
|
||||
certainly be renamed to something longer and less likely to name clash).
|
||||
|
||||
More advanced functionnalities could be added when needed. Here are some
|
||||
references:
|
||||
- https://leconjugueur.lefigaro.fr/frlesnombres.php
|
||||
- https://www.miakinen.net/vrac/nombres
|
||||
- https://www.dcode.fr/ecriture-nombre-lettres
|
||||
|
||||
|
||||
Provided as a 1-function library, and a basic command-line utility (`nbr` — will
|
||||
certainly be renamed to something longer and less likely to name clash).
|
||||
|
@ -1,5 +1,5 @@
|
||||
let rec parse_and_print () =
|
||||
print_string "Entier ? > ";
|
||||
print_string "Entier (Ou [Q]uitter [H]elp) ? > ";
|
||||
flush stdout;
|
||||
input_line stdin |> function
|
||||
| "q" | "Q" -> ()
|
||||
|
@ -1,4 +1,4 @@
|
||||
(lang dune 2.0)
|
||||
(lang dune 2.8)
|
||||
|
||||
(generate_opam_files true)
|
||||
(name nombres)
|
||||
|
@ -45,12 +45,12 @@ and jusqua_100 dizaine n =
|
||||
and jusqua_1000 n =
|
||||
let centaine = n / 100 and reste = n mod 100 in
|
||||
let cent = if centaine > 1 && reste = 0 then "cents" else "cent" in
|
||||
( (if centaine = 1 then [ cent ] else [ nombre_of_int centaine; cent ])
|
||||
@ if reste = 0 then [] else [ nombre_of_int reste ] )
|
||||
((if centaine = 1 then [ cent ] else [ nombre_of_int centaine; cent ])
|
||||
@ if reste = 0 then [] else [ nombre_of_int reste ])
|
||||
|> String.concat " "
|
||||
|
||||
and jusqua_1000000 n =
|
||||
let milliers = n / 1000 and reste = n mod 1000 in
|
||||
( (if milliers = 1 then [ "mille" ] else [ nombre_of_int milliers; "mille" ])
|
||||
@ if reste = 0 then [] else [ nombre_of_int reste ] )
|
||||
((if milliers = 1 then [ "mille" ] else [ nombre_of_int milliers; "mille" ])
|
||||
@ if reste = 0 then [] else [ nombre_of_int reste ])
|
||||
|> String.concat " "
|
||||
|
27
nombres.opam
27
nombres.opam
@ -1,27 +0,0 @@
|
||||
# This file is generated by dune, edit dune-project instead
|
||||
opam-version: "2.0"
|
||||
description: """
|
||||
Convert ints into french.
|
||||
|
||||
Some references:
|
||||
- https://leconjugueur.lefigaro.fr/frlesnombres.php
|
||||
- https://www.miakinen.net/vrac/nombres
|
||||
- https://www.dcode.fr/ecriture-nombre-lettres
|
||||
"""
|
||||
depends: [
|
||||
"dune" {>= "2.0"}
|
||||
]
|
||||
build: [
|
||||
["dune" "subst"] {pinned}
|
||||
[
|
||||
"dune"
|
||||
"build"
|
||||
"-p"
|
||||
name
|
||||
"-j"
|
||||
jobs
|
||||
"@install"
|
||||
"@runtest" {with-test}
|
||||
"@doc" {with-doc}
|
||||
]
|
||||
]
|
Loading…
Reference in New Issue
Block a user