Show pageOld revisionsBacklinksExport to PDFFold/unfold allBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== pears.commathousands ====== <WRAP center round info> Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace. </WRAP> ===== Original SQL ===== <code sql> COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."commathousands" IS {create function commathousands /* Application Maintained Function / Procedure - DO NOT EDIT*/ (in d double) returns char(20) begin declare rv char(20); declare s char(20); declare t char(20); declare i integer; declare c char(1); if d is null then return null end if; if d < 0 then set d=abs(d); set c='-' else set c='' end if; set rv=''; set s=trim(str(d,20,0)); set i=-1; lbl: loop set t=substr(s,i,-3); if t = '' then leave lbl end if; if rv <> '' then set rv=','+rv end if; set rv=t+rv; set i=i-3 end loop lbl; return(c+rv) end } </code> database/procedures/pears_commathousands.txt Last modified: 2026/08/07 19:24by 127.0.0.1