
? Truncar(123.456789,2)
-> 123.45
*-------------------------------------------
* FUNCTION Truncar(tnNro, tnDec)
*-------------------------------------------
* Trunca un número en "n" posiciones decimales
* USO: Truncar(nNumero, nDecimales)
* PARAMETROS:
* tnNro = Número a truncar
* tnDec = Número de cifras decimales a truncar
* RETORNO: Numérico
*-------------------------------------------
FUNCTION Truncar(tnNro, tnDec)
LOCAL ln
IF EMPTY(tnDec)
tnDec = 0
ENDIF
ln = 10 ^ tnDec
RETURN ROUND(INT(tnNro * ln) / ln, tnDec)
ENDFUNC
*-------------------------------------------Luis María Guayán
Estupendo, justo lo que necesitaba. Muchas gracias.
ResponderBorrarExcelente!!
ResponderBorrarMe funciono, mis respetos Luis Maria.
ResponderBorrar