本文整理汇总了C#中BigDecimal.MovePointLeft方法的典型用法代码示例。如果您正苦于以下问题:C# BigDecimal.MovePointLeft方法的具体用法?C# BigDecimal.MovePointLeft怎么用?C# BigDecimal.MovePointLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigDecimal
的用法示例。
在下文中一共展示了BigDecimal.MovePointLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MovePointLeftI
public void MovePointLeftI()
{
BigDecimal movePtLeft = BigDecimal.Parse("123456265.34");
BigDecimal alreadyMoved = movePtLeft.MovePointLeft(5);
Assert.IsTrue(alreadyMoved.Scale == 7 && alreadyMoved.ToString().Equals("1234.5626534"), "move point left 5 failed");
movePtLeft = new BigDecimal(value2.Negate(), 0);
alreadyMoved = movePtLeft.MovePointLeft(12);
Assert.IsTrue(alreadyMoved.Scale == 12 && alreadyMoved.ToString().Equals("-0.012334560000"),
"move point left 12 failed");
movePtLeft = new BigDecimal(123E18);
alreadyMoved = movePtLeft.MovePointLeft(2);
Assert.IsTrue(alreadyMoved.Scale == movePtLeft.Scale + 2 && alreadyMoved.ToDouble() == 1.23E18,
"move point left 2 failed");
movePtLeft = new BigDecimal(1.123E-12);
alreadyMoved = movePtLeft.MovePointLeft(3);
Assert.IsTrue(alreadyMoved.Scale == movePtLeft.Scale + 3 && alreadyMoved.ToDouble() == 1.123E-15,
"move point left 3 failed");
movePtLeft = new BigDecimal(value, 2);
alreadyMoved = movePtLeft.MovePointLeft(-2);
Assert.IsTrue(alreadyMoved.Scale == movePtLeft.Scale - 2 && alreadyMoved.ToString().Equals("12345908"),
"move point left -2 failed");
}