ODBiC Discussion Board


Bug in ODBiC 2.2 $FORMAT() function and FORMAT command

by Kurt Usowski, January 4, 2005 06:17

ODBiC version 2.2 has a bug in the $FORMAT() fucntion and FORMAT commands that makes ODBiC crash when trying to format a number with 9 or more digits. Perhaps this has been fixed in ODBscript?

I have used variations of the following function as a workaround.

<!--FUNCTION NineDigit(in_number) -->
	<!--IF INT($in_number$/1000000) > 0 -->
		<!--SET out_number = $TRIM(INT($in_number$/1000000))"," -->
		<!--SET temp_number = MOD($in_number$,1000000) -->
		<!--SET out_number = $out_number$$RIGHT("000"$TRIM(INT($temp_number$/1000))",",4) -->
		<!--SET temp_number = MOD($temp_number$,1000) -->
		<!--SET out_number = $out_number$$RIGHT("000"$TRIM(INT($temp_number$)),3) -->
	   <!--ELSE-->
		<!--IF INT($in_number$/1000) > 0 AND $in_number$ < 1000000 -->
			<!--SET out_number = $TRIM(INT($in_number$/1000))"," -->
			<!--SET temp_number = MOD($in_number$,1000) -->
			<!--SET out_number = $out_number$$RIGHT("000"$TRIM(INT($temp_number$)),3) -->
		   <!--ELSE-->
			<!--SET out_number = $TRIM(INT($in_number$)) -->
		   <!--ENDIF-->
	   <!--ENDIF-->
   <!--RETURN($out_number$) -->

ODBiC powers the State of the CIties Data Systems


Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.