Vote count:
0
The problem:
The API I'm using for building stacks in rapidweaver doesn't allow for division or floats, but I essentially want to divide a number by another number.
The relevant rules of the API:
The API is placed inside html, css, and javascript files and is compiled into actual html, css, and javascript before generating the project files.
In this API each mathematical operation is wrapped in:
%( math )%
So to achieve (1 + 3) * 6 it'd be:
%( %( 1 + 3 )% * 6 )%
Using
%( 1 + 3 * 6 )%
would break it, only one operation is allowed inside each%()%
.Also, I can use variables which will represent user input
%id=variableName%
So, if I want to multiply user input by 2 I can do:
%( %id=variableName% * 2 )%
What I want to do:
%( %id=CB_seconds% / 2 )%
OR %( %id=CB_seconds% * 0.5 )%
But ^these^ are not allowed for some stupid reason...
I want to take the user input %id=CB_seconds%
, and divide it in half. The user will define %id=CB_seconds%
as an integer between 0 and 10,000. I need both the original value and the divided value in different areas. One possible solution is to have the user specify a value between 0 and 5,000 and multiply this value by two. However, this wont work because the user is defining the length of an animation and it's confusing to ask them to specify half the length they really want.
My Question
Is there some way to get half of a number using ONLY integers and multiplication/addition/subtraction, and without knowing what the number will be before hand?
Aucun commentaire:
Enregistrer un commentaire