ASP

本类阅读TOP10

·asp常用数据库连接方法和技巧
·无组件生成BMP验证码
·一些常用的辅助代码 (网络收藏)
·JavaScript实现的数据表格:冻结列、调整列宽和客户端排序
·VisualStudio.NET_2003及其 MSDN 下载地址
·ASP模拟MVC模式编程
·图片以二进制流输出到网页
·MD5加密算法 ASP版
·ASP.NET编程中的十大技巧
·改进 ASP 的字符串处理性能

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
ASP 写的判断 Money 各个位值的函数

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

最近在公司做一个帐务报销系统。
需要把一个MONEY值的个位十位百位千位还有角啊分啊的单独取出来生成表格。
于是写了一个得到此值的 Function ,放到这里共享。如果你看到有写得不妥的地方,请给我来 [email protected] 指正交流。

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

当然在此基础上你还可以得到万位十万位等。
希望对有需要的朋友有所帮助。


相关文章

相关软件