当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET Decimal.One字段代码示例

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


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

示例1: DecimalFieldsDemo

' Example of the Decimal fields.
Module DecimalFieldsDemo
    
    Sub Main( )

        Const numberFmt As String = "{0,-25}{1,45:N0}"
        Const exprFmt As String = "{0,-55}{1,15}"

        Console.WriteLine( _
            "This example of the fields of the Decimal structure" & _
            vbCrLf & "generates the following output." & vbCrLf )
        Console.WriteLine( numberFmt, "Field or Expression", "Value" )
        Console.WriteLine( numberFmt, "-------------------", "-----" )

        ' Display the values of the Decimal fields.
        Console.WriteLine( numberFmt, "Decimal.MaxValue", _
            Decimal.MaxValue )
        Console.WriteLine( numberFmt, "Decimal.MinValue", _
            Decimal.MinValue )
        Console.WriteLine( numberFmt, "Decimal.MinusOne", _
            Decimal.MinusOne )
        Console.WriteLine( numberFmt, "Decimal.One", _
            Decimal.One )
        Console.WriteLine( numberFmt, "Decimal.Zero", _
            Decimal.Zero )
        Console.WriteLine( )

        ' Display the values of expressions of the Decimal fields.
        Console.WriteLine( exprFmt, _
            "( Decimal.MinusOne + Decimal.One ) = Decimal.Zero", _
            ( Decimal.MinusOne + Decimal.One ) = Decimal.Zero )
        Console.WriteLine( exprFmt, _
            "Decimal.MaxValue + Decimal.MinValue", _
            Decimal.MaxValue + Decimal.MinValue )
        Console.WriteLine( exprFmt, _
            "Decimal.MinValue / Decimal.MaxValue", _
            Decimal.MinValue/Decimal.MaxValue )
        Console.WriteLine( "{0,-40}{1,30}", _
            "100000000000000D / Decimal.MaxValue", _
            100000000000000D / Decimal.MaxValue )
    End Sub 
End Module 

' This example of the fields of the Decimal structure
开发者ID:VB.NET开发者,项目名称:System,代码行数:44,代码来源:Decimal.One

输出:

Field or Expression                                              Value
-------------------                                              -----
Decimal.MaxValue                79,228,162,514,264,337,593,543,950,335
Decimal.MinValue               -79,228,162,514,264,337,593,543,950,335
Decimal.MinusOne                                                    -1
Decimal.One                                                          1
Decimal.Zero                                                         0

( Decimal.MinusOne + Decimal.One ) = Decimal.Zero                 True
Decimal.MaxValue + Decimal.MinValue                                  0
Decimal.MinValue / Decimal.MaxValue                                 -1
100000000000000D / Decimal.MaxValue     0.0000000000000012621774483536


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