actionscript 3 - Fahrenheit to Celsius converter is there a better way? -


Here I have an AS3 fahrenheit for Celsius Converter, I'm thinking that keeping this thing in mind only A better way of completing the function is the dose work for time? & Lt; & Lt; Only when there is 2 decimal places & Gt; & Gt; Function RandomNumber (minimum: number, max: number = 0): number {return mathematical (Math. Random) * (maximum - minimum)) + minutes; } (Var i: int = 0; i & lt; 20; i ++) {var fahrenheit: number = random number (-50, 100) function fahrenheit 2 celsius (fahrenheit): number {var celsius: number = fahrenheit celsius = Fahrenheit - 32 Celsius = Celsius = 1.8 Celsius = Celsius * 10 ^ 2 Celsius = Celsius + .5 Celsius = Celsius / 10 Returns (Celsius)} Trace (Fahrenheit + "Fahrenheit", Fahrenheit 2 Celsius (Fahrenheit) + "Celsius" ,}}

Why not:

  Function Fahrenheit 2 Celsius (Fahrenheit): Number {Var Celsius: number = (5/9) * (Fahrenheit-32); Return Mathematical (Celsius); // & lt; - If you want to round the nearest int? }    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -