Could someone explain to me what the code below does and why it is throwing an error?
rRemoveLeadingZeros=true
rDecimalPlaces=true
strTemp=rValue=00000000986
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Left'
/library\includes\functions\funcFormatMyNumber.inc.asp, line 21
Thanks in advance.
rRemoveLeadingZeros=true
rDecimalPlaces=true
strTemp=rValue=00000000986
Code:
if rRemoveLeadingZeros = True then
strTemp = REReplace("^0+([0-9]{" & rDecimalPlaces + 1 & ",})$",strTemp,"$1")
end if
'line 21
strTemp = Left(strTemp,(Len(strTemp) - rDecimalPlaces)) & "." & Right(strTemp,rDecimalPlaces)
if rRemoveTrailingZeros = True then
strTemp = REReplace("([0-9\.]+)0+$",strTemp,"$1")
end if
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Left'
/library\includes\functions\funcFormatMyNumber.inc.asp, line 21
Thanks in advance.