您好,欢迎光临本网站![请登录][注册会员]  
文件名称: math function
  所属分类: VB
  开发工具:
  文件大小: 7kb
  下载次数: 0
  上传时间: 2013-04-10
  提 供 者: alvi*****
 详细说明: Imports System.Globalization Imports System.Math Imports System.Collections.Generic Namespace xFunction Public Class f Const NumList = "零壹贰叁肆伍陆柒捌玖" Const UnitList = "仟佰拾亿仟佰拾万仟佰拾元角分" Public Shared Sub StringList() Dim tmepList As New List(Of String) Console.WriteLine(vbLf & "Capacity: {0}", tmepList.Capacity) tmepList.Add("Tyrannosaurus") tmepList.Add("Amargasaurus") tmepList.Add(&quo t;Mamenchisaurus") tmepList.Add("Deinonychus") tmepList.Add("Compsognathus") Console.WriteLine() For Each dinosaur As String In tmepList Console.WriteLine(dinosaur) Next Console.WriteLine(vbLf & "Capacity: {0}", tmepList.Capacity) Console.WriteLine("Count: {0}", tmepList.Count) Console.WriteLine(vbLf & "Contains(""Deinonychus""): {0}", _ tmepList.Contains("Deinonychus")) Console.WriteLine(vbLf & "Insert(2, ""Compsognathus"")") tmepList.Insert(2, "Compsognathus") Console.WriteLine() For Each dinosaur As String In tmepList Console.WriteLine(dinosaur) Next Console.WriteLine(vbLf & "tmepList(3): {0}", tmepList(3)) Console.WriteLine(vbLf & "Remove(""Compsognathus"")") tmepList.Remove("Compsognathus") Console.WriteLine() For Each dinosaur As String In tmepList Console.WriteLine(dinosaur) Next tmepList.TrimExcess() Console.WriteLine(vbLf & "TrimExcess()") Console.WriteLine("Capacity: {0}", tmepList.Capacity) Console.WriteLine("Count: {0}", tmepList.Count) tmepList.Clear() Console.WriteLine(vbLf & "Clear()") Console.WriteLine("Capacity: {0}", tmepList.Capacity) Console.WriteLine("Count: {0}", tmepList.Count) End Sub #Region "RMB number to Word" Public Shared Function RmbNumberToWordFull(ByVal Number As Decimal) As String 'RMB 数字大写 If Number = 0 Then Return "零元整" If Number > 999999999999D Then Return "Error" Try Dim unitCharSet() As Char = UnitList.ToCharArray Dim digitalCharSet() As Char = NumList.ToCharArray Dim sOriginalNumber As String = CStr(Round(Number * 100, 0)) Dim cOriginalCharSet() As Char = sOriginalNumber.ToCharArray Dim numWords As String = "" Array.Reverse(cOriginalCharSet) Array.Reverse(unitCharSet) For i As Int16 = 0 To cOriginalCharSet.Length - 1 numWords = digitalCharSet(Val(cOriginalCharSet(i))) & unitCharSet(i) & numWords Next Return numWords Catch ex As Exception 'MessageBox.Show(ex.Message) Return "Error" End Try End Function Public Shared Function RmbNumberToWordStandard(ByVal Number As Decimal) As String Dim numWords As String = "" If Number = 0 Then Return "零元整" Try numWords = RmbNumberToWordFull(Number) For i As Int16 = 1 To 4 numWords = numWords.Replace("零仟", "零") numWords = numWords.Replace("零佰", "零") numWords = numWords.Replace("零拾", "零") numWords = numWords.Replace("零零", "零") numWords = numWords.Replace("零亿", "亿") numWords = numWords.Replace("零万", "万") numWords = numWords.Replace("零元", "元") numWords = numWords.Replace("亿万", "亿") numWords = numWords.Replace("零角零分", "整") numWords = numWords.Replace("零角", "零") numWords = numWords.Replace("零分", "整") Next Return numWords Catch ex As Exception Return "Error" End Try End Function #End Region End Class Public Class Collection(Of ItemType) Shared Items As New List(Of ItemType) Public Shared Sub Add(ByVal Value As ItemType) Items.Add(Value) End Sub Public Shared Function GetList() As ItemType End Function End Class Public Class xDatetime 'Dateteim convertion class,All functions are shared. Public Shared Function GetMonthList(Optional ByVal MonthCount As Int16 = 5) As String() If MonthCount = 0 Then MonthCount = 1 End If Dim ItemCount As UInt16 = Math.Abs(MonthCount) - 1 Dim dt As Date Dim Monthlist(ItemCount) As String dt = Date.Today For iMonth As Int16 = 0 To ItemCount Step 1 Dim newDT As Date If MonthCount >= 0 Then newDT = DateAdd(DateInterval.Month, iMonth, dt) Else newDT = DateAdd(DateInterval.Month, iMonth + MonthCount, dt) End If Monthlist(iMonth) = newDT.ToString("yyyyMM") Next Return Monthlist End Function Public Shared Function CYYYYMMToMMM(ByVal RegionName As String, ByVal sYYYYMM As String) As String 'Convert month formatn egg .convert "201101" to "Jan" 'Note: string start position is begin form 0 Dim dt As DateTime = New DateTime(sYYYYMM.Substring(0, 4), sYYYYMM.Substring(4, 2), 1) Select Case RegionName Case "US" CYYYYMMToMMM = dt.ToString("MMM", DateTimeFormatInfo.InvariantInfo) Case "CN" CYYYYMMToMMM = dt.ToString("MMM", DateTimeFormatInfo.InvariantInfo) Case Else CYYYYMMToMMM = dt.ToString("MMM", DateTimeFormatInfo.InvariantInfo) End Select End Function Public Shared Function MonthFirstDayYYYYMMDD(ByVal sYYYYMM As String) As String Dim dt As DateTime = New DateTime(sYYYYMM.Substring(0, 4), sYYYYMM.Substring(4, 2), 1) Return dt.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo) End Function Public Shared Function MonthLastDayYYYYMMDD(ByVal sYYYYMM As String) As String Dim dt As DateTime = New DateTime(sYYYYMM.Substring(0, 4), sYYYYMM.Substring(4, 2), 1) dt = dt.AddMonths(1).AddDays(-1) Return dt.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo) End Function End Class End Namespace ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: math function
 输入关键字,在本站1000多万海量源码库中尽情搜索: