ASP 写的判断 Money 各个位值的函数

需要把一个MONEY值的个位十位百位千位还有角啊分啊的单独取出来生成表格。

Function Moneynm(n,m)
        checkPoint = InstrRev(n,".")
  If n>9999.99 Then
      Response.write"数据超过限制,请确定您的报销金额在9999.99元以内!"
  Else
    If (checkPoint <> 0) Then
      leftNum = Mid(n,1,checkPoint-1)
      rightNum = Mid(n,checkPoint+1,Len(n))
      Else
      leftNum = n
    End If
     gw = Mid(leftNum,Len(leftNum),Len(leftNum))
     sw = 0
     bw = 0
     qw = 0
     jw = 0
     fw = 0
    If Len(leftNum)>1 Then
        sw = Mid(leftNum,Len(leftNum)-1,1)
    End If
    If Len(leftNum)>2 Then
        bw = Mid(leftNum,Len(leftNum)-2,1)
    End If
    If Len(leftNum)>3 Then
        qw = Mid(leftNum,Len(leftNum)-3,1)
    End If
    If Len(rightNum)>0 Then
        jw = Mid(rightNum,1,1)
    End If
    If Len(rightNum)>1 Then
        fw = Mid(rightNum,2,1)
    End If
  Select case m
  case "gw"
    Response.Write gw
  case "sw"
    Response.Write sw
  case "bw"
    Response.Write bw
  case "qw"
    Response.Write qw
  case "jw"
    Response.Write jw
  case "fw"
    Response.Write fw
  End Select
 End If
End Function

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值