2012-10-17 12:45 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/acctmnth.prg
  * contrib/hbnf/acctyear.prg
  * contrib/hbnf/madd.prg
  * contrib/hbnf/popadder.prg
  * contrib/hbnf/round.prg
    ! fixed wrongly formatted negative numbers
This commit is contained in:
Viktor Szakats
2012-10-17 10:46:54 +00:00
parent 9c2f12afec
commit 2224e491b1
6 changed files with 14 additions and 6 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-17 12:45 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/acctmnth.prg
* contrib/hbnf/acctyear.prg
* contrib/hbnf/madd.prg
* contrib/hbnf/popadder.prg
* contrib/hbnf/round.prg
! fixed wrongly formatted negative numbers
2012-10-17 11:43 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/popadder.prg
* minor formatting (in part to be more hbformat friendly)

View File

@@ -45,7 +45,7 @@ FUNCTION FT_ACCTMONTH( dGivenDate, nMonthNum )
IF dGivenDate < aRetVal[ 2 ]
dGivenDate := FT_MADD( dGivenDate, - 1 )
dGivenDate := FT_MADD( dGivenDate, -1 )
aRetVal := FT_MONTH( dGivenDate )
nMTemp -= 1
IF nMTemp == 0

View File

@@ -41,7 +41,7 @@ FUNCTION FT_ACCTYEAR( dGivenDate )
IF dGivenDate < aRetVal[ 2 ]
aRetVal := FT_YEAR( FT_MADD( dGivenDate, - 1 ) )
aRetVal := FT_YEAR( FT_MADD( dGivenDate, -1 ) )
nYTemp--
aRetVal[ 2 ] := FT_ACCTADJ( aRetVal[ 2 ] )
aRetVal[ 3 ] := FT_ACCTADJ( aRetVal[ 3 ], .T. )

View File

@@ -45,7 +45,7 @@ FUNCTION FT_MADD( dGivenDate, nAddMonths, lMakeEOM )
/* Work with 1st of months.*/
FOR i := 1 TO Abs( nAddMonths )
dTemp += iif( nAddMonths > 0, 31, - 1 )
dTemp += iif( nAddMonths > 0, 31, -1 )
dTemp += 1 - Day( dTemp )
NEXT

View File

@@ -874,8 +874,8 @@ STATIC FUNCTION _ftRoundIt( nNumber, nPlaces )
nPlaces := iif( nPlaces == NIL, 0, nPlaces )
RETURN iif( nNumber < 0.0, - 1.0, 1.0 ) * ;
Int( Abs( nNumber ) * 10 ^ nPlaces + 0.50 + 10 ^ - 12 ) / 10 ^ nPlaces
RETURN iif( nNumber < 0.0, -1.0, 1.0 ) * ;
Int( Abs( nNumber ) * 10 ^ nPlaces + 0.50 + 10 ^ -12 ) / 10 ^ nPlaces
/*+- Function ---------------------------------------------------------------+
| Name: _ftDivide() Docs: Keith A. Wire |

View File

@@ -64,7 +64,7 @@ FUNCTION FT_ROUND( nNumber, nRoundToAmount, cRoundType, cRoundDirection, ;
; // Are We Rounding Up??
iif( Left( cRoundDirection, 1 ) == ROUND_UP, ;
; // Yes, Make Upward Adjustment
- 1 / ( nRoundToAmount ) / 2, ;
-1 / nRoundToAmount / 2, ;
; // No, Rounding Normal, No Adjustment
0 ) )
//Do the Actual Rounding