Package org.jExigo

Examples of org.jExigo.FixedDecimalNumber.truncate()


public void testTruncate()
{
  FixedDecimalNumber fda = new FixedDecimalNumber("1");
  try {
    fda.truncate(9)// too big but not an error
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1",  fda.get());
 
View Full Code Here


  }
  assertEquals("1",  fda.get());
 
  fda = new FixedDecimalNumber("1");
  try {
    fda.truncate(-9);
    fail("should throw exception");
  } catch (Exception e) {
   
  }
 
View Full Code Here

   
  }
 
  fda = new FixedDecimalNumber("1.0");
  try {
    fda.truncate(9)// too big but not an error
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1.0",  fda.get());
 
View Full Code Here

  }
  assertEquals("1.0",  fda.get());
 
  fda = new FixedDecimalNumber("1.0");
  try {
    fda.truncate(0);
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1",  fda.get())
 
View Full Code Here

  }
  assertEquals("1",  fda.get())
 
  fda = new FixedDecimalNumber("1.0");
  try {
    fda.truncate(9)// too big but not an error
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1.0",  fda.get());
 
View Full Code Here

  }
  assertEquals("1.0",  fda.get());
 
  fda = new FixedDecimalNumber("1.00000000000000");
  try {
    fda.truncate(0);
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1",  fda.get());
 
View Full Code Here

  }
  assertEquals("1",  fda.get());
 
  fda = new FixedDecimalNumber("1.09");
  try {
    fda.truncate(1)
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1.0",  fda.get());
 
View Full Code Here

  }
  assertEquals("1.0",  fda.get());
 
  fda = new FixedDecimalNumber("1.09");
  try {
    fda.truncate(2);
  } catch (Exception e) {
    fail(e.getMessage());
  }
  assertEquals("1.09",  fda.get());
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.