Ver Mensaje Individual
  #5 (permalink)  
Antiguo 17/02/2016, 12:19
Avatar de Profesor_Falken
Profesor_Falken
 
Fecha de Ingreso: agosto-2014
Ubicación: Mountain View
Mensajes: 1.323
Antigüedad: 9 años, 9 meses
Puntos: 182
Respuesta: separar de un Bigdecimal la parte entera y la decimal

Buenas,

Y no te funciona el split???

A mi me funciona sin problemas. Copia este codigo y pruebalo:

Código Java:
Ver original
  1. public static void main(String[] args) {
  2.         BigDecimal big = new BigDecimal("925.0000");
  3.         System.out.println("result: " + big.toString());
  4.         String[] parts = big.toString().split("\\.");
  5.         System.out.println("Parte entera: " + parts[0]);
  6.         System.out.println("Parte decimal: " + parts[1]);
  7.     }


Salida:
result: 925.0000
Parte entera: 925
Parte decimal: 0000


Un saludo
__________________
If to err is human, then programmers are the most human of us