Take a price, for example 1.4322 (For most pairs) or 121.97 (for Yen Pairs).
How do you write a function with two inputs of price that returns price values to the nearest zero?
Example: 1.4322 as 1.4320 (realize the last digit is zero) and 121.97 to 122.00.
I used this function, but it did not work for some reason:
Anyone know why ?
How do you write a function with two inputs of price that returns price values to the nearest zero?
Example: 1.4322 as 1.4320 (realize the last digit is zero) and 121.97 to 122.00.
I used this function, but it did not work for some reason:
Inserted Code
double ZeroUp(double price) //Function added to get nearest zeros value. { return((MathRound(price/Point))*Point); //This converts values like 1.4322 and 121.97 into 14322 and 12197. } //Then it rounds it up to the nearest zero: 14322 to 14320 and 12197 to 12200. //Lastly, it returns the values back as price values such as 1.4320 and 122.00.
Anyone know why ?