本文整理汇总了C#中BigDecimal.MovePointRight方法的典型用法代码示例。如果您正苦于以下问题:C# BigDecimal.MovePointRight方法的具体用法?C# BigDecimal.MovePointRight怎么用?C# BigDecimal.MovePointRight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigDecimal
的用法示例。
在下文中一共展示了BigDecimal.MovePointRight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MovePointRightI
public void MovePointRightI()
{
BigDecimal movePtRight = BigDecimal.Parse("-1.58796521458");
BigDecimal alreadyMoved = movePtRight.MovePointRight(8);
Assert.IsTrue(alreadyMoved.Scale == 3 && alreadyMoved.ToString().Equals("-158796521.458"),
"move point right 8 failed");
movePtRight = new BigDecimal(value, 2);
alreadyMoved = movePtRight.MovePointRight(4);
Assert.IsTrue(alreadyMoved.Scale == 0 && alreadyMoved.ToString().Equals("1234590800"), "move point right 4 failed");
movePtRight = new BigDecimal(134E12);
alreadyMoved = movePtRight.MovePointRight(2);
Assert.IsTrue(alreadyMoved.Scale == 0 && alreadyMoved.ToString().Equals("13400000000000000"),
"move point right 2 failed");
movePtRight = new BigDecimal(-3.4E-10);
alreadyMoved = movePtRight.MovePointRight(5);
Assert.IsTrue(alreadyMoved.Scale == movePtRight.Scale - 5 && alreadyMoved.ToDouble() == -0.000034,
"move point right 5 failed");
alreadyMoved = alreadyMoved.MovePointRight(-5);
Assert.IsTrue(alreadyMoved.Equals(movePtRight), "move point right -5 failed");
}