• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

VB.NET Decimal.Implicit操作符代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了VB.NET中System.Decimal.Implicit操作符的典型用法代码示例。如果您正苦于以下问题:VB.NET Decimal.Implicit操作符的具体用法?VB.NET Decimal.Implicit怎么用?VB.NET Decimal.Implicit使用的例子?那么恭喜您, 这里精选的操作符代码示例或许可以为您提供帮助。您也可以进一步了解该操作符所在System.Decimal的用法示例。



在下文中一共展示了Decimal.Implicit操作符的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。

示例1: Main

Module Example
    Public Sub Main()
        ' Define an array of 32-bit unsigned integer values.
        Dim values() As UInteger = { UInteger.MinValue, UInteger.MaxValue, 
                                     &hFFFFFF, 123456789, 4000000000 }
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)           
        Next   
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:13,代码来源:Decimal.Implicit

输出:

0 (UInt32) --> 0 (Decimal)
4294967295 (UInt32) --> 4294967295 (Decimal)
16777215 (UInt32) --> 16777215 (Decimal)
123456789 (UInt32) --> 123456789 (Decimal)
4000000000 (UInt32) --> 4000000000 (Decimal)


示例2: Main

Module Example
    Public Sub Main()
        ' Define an array of 16-bit unsigned integer values.
        Dim values() As Decimal = { UShort.MinValue, UShort.MaxValue,     
                                    &hFFF, 12345, 40000 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)         
        Next
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:14,代码来源:Decimal.Implicit

输出:

0 (Decimal) --> 0 (Decimal)
65535 (Decimal) --> 65535 (Decimal)
4095 (Decimal) --> 4095 (Decimal)
12345 (Decimal) --> 12345 (Decimal)
40000 (Decimal) --> 40000 (Decimal)


示例3: Main

Module Example
    Public Sub Main()
        ' Define an array of 8-bit signed integer values.
        Dim values() As SByte = { SByte.MinValue, SByte.MaxValue,     
                                  &h3F, 123, -100 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next                         
    End Sub
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:14,代码来源:Decimal.Implicit

输出:

-128 (SByte) --> -128 (Decimal)
127 (SByte) --> 127 (Decimal)
63 (SByte) --> 63 (Decimal)
123 (SByte) --> 123 (Decimal)
-100 (SByte) --> -100 (Decimal)


示例4: Main

Module Example
    Public Sub Main()
        ' Define an array of 64-bit integer values.
        Dim values() As Long = { Long.MinValue, Long.MaxValue, 
                                 &hFFFFFFFFFFFF, 123456789123456789,
                                 -1000000000000000 }
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:15,代码来源:Decimal.Implicit

输出:

-9223372036854775808 (Int64) --> -9223372036854775808 (Decimal)
9223372036854775807 (Int64) --> 9223372036854775807 (Decimal)
281474976710655 (Int64) --> 281474976710655 (Decimal)
123456789123456789 (Int64) --> 123456789123456789 (Decimal)
-1000000000000000 (Int64) --> -1000000000000000 (Decimal)


示例5: Main

Module Example
    Public Sub Main
        ' Define an array of byte values.
        Dim values() As Byte = { Byte.MinValue, Byte.MaxValue, 
                                 &h3F, 123, 200 }   
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)                   
        Next   
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:14,代码来源:Decimal.Implicit

输出:

0 (Byte) --> 0 (Decimal)
255 (Byte) --> 255 (Decimal)
63 (Byte) --> 63 (Decimal)
123 (Byte) --> 123 (Decimal)
200 (Byte) --> 200 (Decimal)


示例6: Main

Module Example
    Public Sub Main()
        ' Define an array of 16-bit integer values.
        Dim values() As Short = { Short.MinValue, Short.MaxValue, 
                                  &hFFF, 12345, -10000 }   
        ' Convert each value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)         
        Next
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:14,代码来源:Decimal.Implicit

输出:

-32768 (Int16) --> -32768 (Decimal)
32767 (Int16) --> 32767 (Decimal)
4095 (Int16) --> 4095 (Decimal)
12345 (Int16) --> 12345 (Decimal)
-10000 (Int16) --> -10000 (Decimal)


示例7: Example

Module Example
    Public Sub Main()
        ' Define an array of Char values.
        Dim values() As Char = { ChrW(0), " "c, "*"c, "A"c, "a"c, 
                                 "{"c, "Æ"c }

        ' Convert each Char value to a Decimal.
        For Each value In values
           Dim decValue As Decimal = Decimal.op_Implicit(value)
           Console.WriteLine("'{0}' ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)      
        Next
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:15,代码来源:Decimal.Implicit

输出:

(Char) --> 0 (Decimal)
(Char) --> 32 (Decimal)
*' (Char) --> 42 (Decimal)
A' (Char) --> 65 (Decimal)
a' (Char) --> 97 (Decimal)
{' (Char) --> 123 (Decimal)
Æ' (Char) --> 198 (Decimal)


示例8: Main

Module Example
    Public Sub Main()
        Dim values() As ULong = { ULong.MinValue, ULong.MaxValue, 
                           &hFFFFFFFFFFFF, 123456789123456789, 
                           1000000000000000 }
        For Each value In values
           Dim decValue As Decimal = value
           Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                             value.GetType().Name, decValue,
                             decValue.GetType().Name)
        Next                              
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:13,代码来源:Decimal.Implicit

输出:

0 (UInt64) --> 0 (Decimal)
18446744073709551615 (UInt64) --> 18446744073709551615 (Decimal)
281474976710655 (UInt64) --> 281474976710655 (Decimal)
123456789123456789 (UInt64) --> 123456789123456789 (Decimal)
1000000000000000 (UInt64) --> 1000000000000000 (Decimal)


示例9: Main

Module Example
    Public Sub Main()
       ' Define an array of 32-bit integer values.
       Dim values() As Integer = { Integer.MinValue, Integer.MaxValue, 
                                   &hFFFFFF, 123456789, -1000000000 }
       ' Convert each value to a Decimal.
       For Each value In values
          Dim decValue As Decimal = value 
          Console.WriteLine("{0} ({1}) --> {2} ({3})", value,
                            value.GetType().Name, decValue,
                            decValue.GetType().Name)
       Next                     
    End Sub 
End Module
开发者ID:VB.NET开发者,项目名称:System,代码行数:14,代码来源:Decimal.Implicit

输出:

-2147483648 (Int32) --> -2147483648 (Decimal)
2147483647 (Int32) --> 2147483647 (Decimal)
16777215 (Int32) --> 16777215 (Decimal)
123456789 (Int32) --> 123456789 (Decimal)
-1000000000 (Int32) --> -1000000000 (Decimal)



注:本文中的System.Decimal.Implicit操作符示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
VB.NET Decimal.LessThan操作符代码示例发布时间:2022-05-24
下一篇:
VB.NET Decimal.Explicit操作符代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap