Page 1 of 1

Sacar decimales

PostPosted: Thu Feb 08, 2024 9:21 pm
by jpcavagnaro
Hola gente, existe alguna manera sencilla de sacar los decimales, hoy en Argentina no tienen sentido los decimales en un sistema de facturación.

Probé:

SET FIXED ON
SET DECIMALS TO 0

sin resultado, para no modificar todo el sistema, aunque en todos lados aparezcan los decimales pero que estén en cero

Re: Sacar decimales

PostPosted: Thu Feb 08, 2024 9:45 pm
by Willi Quintana
MI estimado, prueba esto.
Code: Select all  Expand view
//---------------------------------------------------------------------------------------------
Function NoDec(cVar, nLen)
local nVar, nDec, nTmp
DEFAULT nLen := 12

IF VALTYPE(cVar) = "N"
  nTmp := STR(cVar,12,3)
 Else
  nTmp := cVar
Endif

nVar := VAL(nTmp)

nDec := nVar - INT(nVar)   //   10.00 - 10  = 0

If nDec = 0
  Return(STR(nVar,nLen,0))
EndIf

Return(STR(nVar,nLen,2))
 

Re: Sacar decimales

PostPosted: Thu Feb 08, 2024 11:59 pm
by Armando
Jorge:

Tírale un ojo a este post, mira todo el hilo

viewtopic.php?f=6&t=44201

Saludos