====== pears.iqmoneynumeric ====== Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. ===== Original SQL ===== COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."iqmoneynumeric" IS {create function iqmoneynumeric /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in val numeric) returns numeric begin declare c numeric; declare neg tinyint; set neg = 0; if val < 0 then set neg = 1; end if; set c = ("truncate"(abs(val*1000) + 0.5,0) / 1000); if neg=1 then set c = 0 - c; end if; set neg = 0; if c < 0 then set neg = 1; end if; set c = "truncate"(abs(c*100) + 0.5,0)/100; if neg=1 then set c = 0 - c; end if; return c end }