Initial version.

Features:

- Upload PDF files let them analyze

- Manage meta data and items

- See processing in webapp
This commit is contained in:
Eike Kettner
2019-07-23 00:53:30 +02:00
parent 6154e6a387
commit 831cd8b655
341 changed files with 23634 additions and 484 deletions

View File

@ -0,0 +1,24 @@
module Util.Size exposing (..)
type SizeUnit = G|M|K|B
prettyNumber: Float -> String
prettyNumber n =
let
parts = String.split "." (String.fromFloat n)
in
case parts of
n0 :: d :: [] -> n0 ++ "." ++ (String.left 2 d)
_ -> String.join "." parts
bytesReadable: SizeUnit -> Float -> String
bytesReadable unit n =
let
k = n / 1024
num = prettyNumber n
in
case unit of
G -> num ++ "G"
M -> if k > 1 then (bytesReadable G k) else num ++ "M"
K -> if k > 1 then (bytesReadable M k) else num ++ "K"
B -> if k > 1 then (bytesReadable K k) else num ++ "B"