Commit b1dc7acb authored by Denis Salem's avatar Denis Salem
Browse files

fix random number generator

parent 3f51be73
......@@ -6,5 +6,5 @@ style: features
---
## V __en__ C is super easy to use and learn!
Here's a random number .:GetRandomNumber::0::100::3:.
Here's a random number .:GetRandomNumber::5::10::0:.
.:DoesntExists:.
......@@ -95,7 +95,7 @@
DONE | No more awkward silence when something is successfully done.
DONE | Add more coloration for message!
DONE | Specify where error occurs when parsing patterns.
DONE | More verbosity about wrong pattern arguments.
DONE | More verbosity about wrong pattern arguments.
DONE | Clear white spaces in error messages.
DONE | Speed up blog exportation ( almost seven times faster!).
DONE | Implement RelativeLocation.
......@@ -104,7 +104,7 @@
DONE | Code should be a little bit more PEP 8 compliant.
DONE | Handle currentLocale = locale.getlocale()[0].split('_')[0] AttributeError: 'NoneType'.
DONE | Clean up installation.
DONE | Add random number generator.
DONE | Add random number generator.
WIP | Change nomenclature: Most of the usual patterns are changed. Fix doc.
TODO | Add categories tree in entry.
TODO | Add function Include.
......
......@@ -32,7 +32,8 @@ def get_random_number(in_argv):
except ValueError:
raise PatternInvalidArgument(arg_names[i],in_argv[i], messages.pattern_argument_must_be_integer)
return str(int(random.random() * (argv[1] + 1))) if argv[2] == 0 else str(round(random.random() * (argv[1] + 1), argv[2]))
v = argv[0] + random.random() * (argv[1] - argv[0] + 1)
return str(int(v)) if argv[2] == 0 else str(round(v, argv[2]))
def get_venc_version(argv):
return venc_version
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment