Author Topic: Round 函數強化版  (Read 4087 times)

admin

  • Administrator
  • *****
  • Posts: 0
    • View Profile
Round 函數強化版
« on: August 23, 2011, 07:35:05 PM »
Code: [Select]
Function czRound(tmpValue as double,optional tmpDigit as integer=0) As double
  dim tmpResult as double=0
  dim tmpFormat as string="#"
  dim intX as integer
  if tmpdigit >0 then
    tmpformat="#."
    for intx=1 to tmpDigit
      tmpFormat=tmpFormat +"#"
    next
  end if
 
  tmpResult=cdbl(format(tmpvalue,tmpFormat))
 
  return tmpResult
 
 
End Function
« Last Edit: October 23, 2011, 01:48:05 AM by Roy Chan »