@Test public void testAdd(){ testCall(db,"return apoc.number.exact.add('1213669989','1238126387') as value", row -> assertEquals(new String("2451796376"), row.get("value"))); }
@UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") public String add(@Name("stringA")String stringA, @Name("stringB")String stringB){ if(stringA == null || stringA.isEmpty() || stringB == null || stringB.isEmpty()) return null; return new BigDecimal(stringA).add(new BigDecimal(stringB)).toPlainString(); }
Exact { @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") public String add(@Name("stringA")String stringA, @Name("stringB")String stringB){ if(stringA == null || stringA.isEmpty() || stringB == null || stringB.isEmpty()) return null; return new BigDecimal(stringA).add(new BigDecimal(stringB)).toPlainString(); } }
Exact { @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") public String add(@Name("stringA")String stringA, @Name("stringB")String stringB){ if(stringA == null || stringA.isEmpty() || stringB == null || stringB.isEmpty()) return null; return new BigDecimal(stringA).add(new BigDecimal(stringB)).toPlainString(); }  }
Exact { @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") public String add(@Name("stringA")String stringA, @Name("stringB")String stringB){ if(stringA == null || stringA.isEmpty() || stringB == null || stringB.isEmpty()) return null; return new BigDecimal(stringA).add(new BigDecimal(stringB)).toPlainString(); }  @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") String add(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.sub(stringA,stringB) - return the substraction's of two large numbers") String sub(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.mul(stringA,stringB,[prec],[roundingModel]) - return the multiplication's result of two large numbers ") String mul(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.div(stringA,stringB,[prec],[roundingModel]) - return the division's result of two large numbers") String div(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toInteger(string,[prec],[roundingMode]) - return the Integer value of a large number") Long toInteger(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toFloat(string,[prec],[roundingMode]) - return the Float value of a large number") Double toFloat(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toExact(number) - return the exact value") Long toExact(@Name("number")Long number); }
Exact { @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") public String add(@Name("stringA")String stringA, @Name("stringB")String stringB){ if(stringA == null || stringA.isEmpty() || stringB == null || stringB.isEmpty()) return null; return new BigDecimal(stringA).add(new BigDecimal(stringB)).toPlainString(); }  @UserFunction @Description("apoc.number.exact.add(stringA,stringB) - return the sum's result of two large numbers") String add(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.sub(stringA,stringB) - return the substraction's of two large numbers") String sub(@Name("stringA")String stringA, @Name("stringB")String stringB); @UserFunction @Description("apoc.number.exact.mul(stringA,stringB,[prec],[roundingModel]) - return the multiplication's result of two large numbers ") String mul(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.div(stringA,stringB,[prec],[roundingModel]) - return the division's result of two large numbers") String div(@Name("stringA")String stringA, @Name("stringB")String stringB, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toInteger(string,[prec],[roundingMode]) - return the Integer value of a large number") Long toInteger(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toFloat(string,[prec],[roundingMode]) - return the Float value of a large number") Double toFloat(@Name("stringA")String string, @Name(value = "precision" , defaultValue = "0")Long precision, @Name(value = "roundingMode", defaultValue = "HALF_UP")String roundingMode); @UserFunction @Description("apoc.number.exact.toExact(number) - return the exact value") Long toExact(@Name("number")Long number);  }