For Number data in Oatablebean&oaadvancedtablebean display in specified format

Source: Internet
Author: User

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);

}

Location
Symbol 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".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.