mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-13 16:34:34 +12:00
Fix issue with fractions
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
038e101386
commit
25e0d700a4
|
@ -3,6 +3,7 @@
|
|||
|
||||
import re
|
||||
import time
|
||||
import traceback
|
||||
|
||||
from manuskript.util.counter import CounterKind, CharCounter, WordCounter, PageCounter
|
||||
|
||||
|
@ -65,7 +66,7 @@ def countText(text: str, kind: CounterKind = CounterKind.WORDS):
|
|||
|
||||
|
||||
def safeFraction(value, low, high) -> float:
|
||||
if value < low:
|
||||
if value < low or high <= low:
|
||||
return 0.0
|
||||
elif value > high:
|
||||
return 1.0
|
||||
|
|
Loading…
Reference in a new issue