SAP ABAP 將數字金額轉換為英文

2021-10-07 13:59:40 字數 1161 閱讀 7214

主要運用了 spell_amount函式,但是這個函式無法識別小數點,只好手動將金額字段拆解為整數部分和小數部分,然後分別呼叫函式。

split lv_nu at '.' into lv_zhens  lv_xiaos .

call function 'spell_amount'

exporting

amount          = lv_zhens

*   currency        = ' '

*   filler          = ' '

language        = 'e'

importing

in_words        = lv_en

exceptions

not_found       = 1

too_large       = 2

others          = 3

.if sy-subrc <> 0.

message '錯誤' type 's' display like 'e'.

endif.

concatenate 'us dollar ' lv_en-word  into lv_daxie.

call function 'spell_amount'

exporting

amount          = lv_xiaos

*   currency        = ' '

*   filler          =

language        = 'e'

importing

in_words        = lv_en

exceptions

not_found       = 1

too_large       = 2

others          = 3

.if sy-subrc <> 0.

message '錯誤' type 's' display like 'e'.

endif.

concatenate ' point'  lv_en-dig02 lv_en-dig01 'only' into lv_en-word separated by ' '.

concatenate lv_daxie  lv_en-word into lv_daxie.

將數字轉換為大寫金額

export const changetochinese num num num.replace g,替換tomoney 中的 num num.replace g,替換tomoney 中的空格 num num.replace g,替換掉可能出現的 字元 if isnan num 字元處理完畢後開始轉...

Js 將數字轉換為大寫金額

export const changetochinese num num num.replace g,替換tomoney 中的 num num.replace g,替換tomoney 中的空格 num num.replace g,替換掉可能出現的 字元if isnan num 字元處理完畢後開始轉換...

學習筆記 Java將數字金額轉換為中文金額

description 將數字金額轉換為中文金額 param bigdecimal bigdmoneynumber 轉換前的數字金額 return string 呼叫 mytochinesecurrency 101.89 壹佰零壹圓捌角玖分 mytochinesecurrency 100.89 壹佰...