Description Of BigDecimal: valueOf(long val)
The java.math.BigDecimal.valueOf(long val) translates a long value into a BigDecimal with a scale of zero. This "static factory method" is provided in preference to a ( long ) constructor because it allows for reuse of frequently used BigDecimal values.BigDecimal.valueOf(long val) method returns a BigDecimal whose value is val .
Code Example Java BigDecimal
import java.math.BigDecimal; public class BigDecimalExam { public static void main(String[] args) { Long d = new Long("123"); BigDecimal bg = BigDecimal.valueOf(d); System.out.println(bg); } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น