Share via


DecimalFormat.SignAlwaysShown Property

Definition

<strong>[icu]</strong> Returns whether the sign is being shown on positive numbers. -or- Sets whether to always shown the plus sign ('+' in <em>en</em>) on positive numbers.

public virtual bool SignAlwaysShown { [Android.Runtime.Register("isSignAlwaysShown", "()Z", "GetIsSignAlwaysShownHandler", ApiSince=31)] get; [Android.Runtime.Register("setSignAlwaysShown", "(Z)V", "GetSetSignAlwaysShown_ZHandler", ApiSince=31)] set; }
[<get: Android.Runtime.Register("isSignAlwaysShown", "()Z", "GetIsSignAlwaysShownHandler", ApiSince=31)>]
[<set: Android.Runtime.Register("setSignAlwaysShown", "(Z)V", "GetSetSignAlwaysShown_ZHandler", ApiSince=31)>]
member this.SignAlwaysShown : bool with get, set

Property Value

Whether the sign is shown on positive numbers and zero.

Attributes

Remarks

Property getter documentation:

<strong>[icu]</strong> Returns whether the sign is being shown on positive numbers.

Java documentation for android.icu.text.DecimalFormat.isSignAlwaysShown().

Property setter documentation:

Sets whether to always shown the plus sign ('+' in <em>en</em>) on positive numbers. The rules in UTS #35 section 3.2.1 will be followed to ensure a locale-aware placement of the sign.

More specifically, the following strategy will be used to place the plus sign:

<ol> <li><em>Patterns without a negative subpattern:</em> The locale's plus sign will be prepended to the positive prefix. <li><em>Patterns with a negative subpattern without a '-' sign (e.g., accounting):</em> The locale's plus sign will be prepended to the positive prefix, as in case 1. <li><em>Patterns with a negative subpattern that has a '-' sign:</em> The locale's plus sign will substitute the '-' in the negative subpattern. The positive subpattern will be unused. </ol>

This method is designed to be used <em>instead of</em> applying a pattern containing an explicit plus sign, such as "+0;-0". The behavior when combining this method with explicit plus signs in the pattern is undefined.

Java documentation for android.icu.text.DecimalFormat.setSignAlwaysShown(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to