The data in the number column in Oatablebean&oaadvancedtablebean is automatically displayed by default in the table based on whether the data has decimals, but if all the number columns in the Business requirements table are In particular, the amount column is displayed in a fixed format and requires code control in the CO:
Method One: Display data according to currency (code)
Oamessagestyledtextbean stextbean= (Oamessagestyledtextbean) webbean.findchildrecursive ("column ID");// Oamessagestyledtextbean can be modified according to the situation
if (stextbean!=null) {
Stextbean.setattributevalue (Currency_code, "CNY");
}
Method Two: According to the custom style presentation (code)
Formatter Formatter = new Oadecimalvalidater ("#,###,###,# #0. xx; (#,###,###,# #0.)", "#,###,###,# #0. # #;(#,###,###,## 0.##) ");
Oamessagestyledtextbean stextbean= (Oamessagestyledtextbean) webbean.findchildrecursive ("column ID");// Oamessagestyledtextbean can be modified according to the situation
if (stextbean!=null) {
Stextbean.setattributevalue (on_submit_validater_attr, formatter);
}
Symbol |
| Location
localized? |
meaning |
0 |
Number |
Yes |
Digit |
# |
Number |
Yes |
Digit, zero shows as absent |
. |
Number |
Yes |
Decimal separator or Monetary decimal separator |
- |
Number |
Yes |
Minus sign |
, |
Number |
Yes |
Grouping Separator |
E |
Number |
Yes |
Separates Mantissa and exponent in scientific notation. Need not being quoted in prefix or suffix. |
; |
Subpattern boundary |
Yes |
Separates positive and negative subpatterns |
% |
Prefix or suffix |
Yes |
Multiply by and Show as percentage |
\u2030 |
Prefix or suffix |
Yes |
Multiply by and show as per mille value |
¤ (\U00A4) |
Prefix or suffix |
No |
Currency sign, replaced by Currency symbol. If doubled, replaced by international currency symbol. If present in a pattern, the monetary decimal separator is used instead of the decimal separator. |
' |
Prefix or suffix |
No |
Used to quote special characters in a prefix or suffix, for example, "' # ' #" formats 123 to "#123". To create a single quote itself with the use of a row: "# o ' Clock". |