Convert Money To Money Type USD In PowerBuilder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | global type f_usd from function_object end type forward prototypes global function string f_usd (decimal ad_money) end prototypes global function string f_usd (decimal ad_money);Long ld_tmp, ld_remain String ls_value ld_tmp = Int(ad_money / 100) ls_value = String('100-' + String(ld_tmp), Fill('@',12)) ld_remain = ad_money - (ld_tmp * 100) ld_tmp = Int(ld_remain / 50) ls_value = ls_value + String('50-' + String(ld_tmp), Fill('@',12)) ld_remain = ld_remain - (ld_tmp * 50) ld_tmp = Int(ld_remain / 20) ls_value = ls_value + String('20-' + String(ld_tmp), Fill('@',12)) ld_remain = ld_remain - (ld_tmp * 20) ld_tmp = Int(ld_remain / 10) ls_value = ls_value + String('10-' + String(ld_tmp), Fill('@',12)) ld_remain = ld_remain - (ld_tmp * 10) ld_tmp = Int(ld_remain / 5) ls_value = ls_value + String('5-' + String(ld_tmp), Fill('@',12)) ld_remain = ld_remain - (ld_tmp * 5) ld_tmp = Int(ld_remain / 1) ls_value = ls_value + String('1-' + String(ld_tmp), Fill('@',12)) Return ls_value end function |
Find Projects On Github click here
Good Luck!