Here you can find the source of roundChipRewardDown(long chips)
static public long roundChipRewardDown(long chips)
//package com.java2s; //License from project: Apache License public class Main { public static final double LOG_10 = Math.log(10); static public long roundChipRewardDown(long chips) { if (chips < 1000) return chips; int digits = ((int) Math.floor(Math.log(chips) / LOG_10)) + 1; double divider = Math.pow(10, (digits - 1)); chips = (long) (Math.floor(chips / divider) * divider); return chips; }/*from w w w .ja v a 2s . c o m*/ }