Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strfmt a float

Status
Not open for further replies.

1LastTime

Technical User
Nov 6, 2002
9
US
What I'm I doing wrong.

string sTIME
float fTIME_REM

proc main

fTIME_REM = (5000 * 3 ) / 3600
strfmt sTIME "%-6.2f" fTIME_REM
usermsg sTIME

endproc

The answer should be 4.16.
thanks

 
In the line fTIME_REM = (5000 * 3 ) / 3600, add a .0 to the end of each numeric value. This forces ASPECT to treat the values as floats instead of integers, which is why you were ending up with 4.00 instead of 4.17. I did a quick scan of the ASPECT help file to see if this was mentioned somewhere, but didn't run across any mention of it.
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top