Here you can find the source of doubleToLong(Double aVal)
Parameter | Description |
---|---|
aVal | a parameter |
public static Object doubleToLong(Double aVal)
//package com.java2s; public class Main { /**/*w w w . j ava 2 s .c o m*/ * if the double can safely be converted to a Long then do it. * * @param aVal */ public static Object doubleToLong(Double aVal) { if (Double.compare(aVal, Math.ceil(aVal)) == 0) { return aVal.longValue(); } else return aVal; } }