Answers

Question and Answer:

  Home  SilkTest

⟩ How to retrieve the decimal part of value stored in float variable. Also how to retrieve the Integer part? Is there a function?

the snippet code for the prob.

[ ] real rVal1=89.822 // Assume your real number is rVal1

[ ] integer iValue = [int]rVal1

[ ] real rVal2= rVal1-iValue

[ ] print(iValue) // Integer part of u r number

[ ] print(rVal2) // Decimal part of u r number

 233 views

More Questions for you: