Forum Discussion
areskar
16 years agoVisitor
Thank you very much. This does the trick.
I totally missed the str() function! Perfect.
I totally missed the str() function! Perfect.
- kraken6 years agoChannel Surfer
minutes = (Fix(length / .6) / 100 ). ToStr()
Will produce a number like 1.23
- Tasevski6 years agoBinge Watcher
I've made a small function for formatting an integer or float to have two digits after the decimal point:
function formatTwoDigitFloat(val as dynamic) as string if val = invalid then return "" formattedVal = Str(((val * 100) + 0.1) / 100) return Left(formattedVal, Len(formattedVal) - 1) end function print formatTwoDigitFloat(0) > 0.00 print formatTwoDigitFloat(5) > 5.00 print formatTwoDigitFloat(10) > 10.00 print formatTwoDigitFloat(5.6) > 5.60 print formatTwoDigitFloat(19.6) > 19.60 print formatTwoDigitFloat(19.99) > 19.99 print formatTwoDigitFloat(1.99) > 1.99
Can be modified to support more/less precise output if needed.