Percent
- iOS
- 15.0+
- macOS
- 12.0+
- tvOS
- 15.0+
- watchOS
- 8.0+
struct Percent
struct Percent
s20FoundationEssentials7DecimalV0A20InternationalizationE11FormatStyleV7PercentV
What are these?9FZ6Q
import FoundationInternationalization
import FoundationEssentials
struct FormatStyle
struct Decimal
init(from decoder: any Decoder) throws
init(locale: Locale = .autoupdatingCurrent)
var attributed: Decimal.FormatStyle.Attributed { get }
var locale: Locale
var parseStrategy: Decimal.ParseStrategy<Decimal.FormatStyle> { get }
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Decimal)?
func decimalSeparator(strategy: Decimal.FormatStyle.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle
func format(_ value: Decimal) -> String
func grouping(_ group: Decimal.FormatStyle.Configuration.Grouping) -> Decimal.FormatStyle
func locale(_ locale: Locale) -> Decimal.FormatStyle
func notation(_ notation: Decimal.FormatStyle.Configuration.Notation) -> Decimal.FormatStyle
func precision(_ p: Decimal.FormatStyle.Configuration.Precision) -> Decimal.FormatStyle
func rounded(rule: Decimal.FormatStyle.Configuration.RoundingRule = .toNearestOrEven, increment: Int? = nil) -> Decimal.FormatStyle
func scale(_ multiplicand: Double) -> Decimal.FormatStyle
func sign(strategy: Decimal.FormatStyle.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle
struct Attributed
struct Currency
typealias Configuration = NumberFormatStyleConfiguration
typealias RegexOutput = Decimal
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol CustomConsumingRegexComponent : RegexComponent
protocol Decodable
A type that can decode itself from an external representation.
protocol Encodable
A type that can encode itself to an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Escapable
protocol FormatStyle : Decodable, Encodable, Hashable
A type that can convert a given data type into a representation.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol ParseableFormatStyle : FormatStyle
A type that can convert a given data type into a representation.
protocol RegexComponent<RegexOutput>
A type that represents a regular expression.
protocol Sendable
init(from decoder: any Decoder) throws
init(locale: Locale = .autoupdatingCurrent)
var attributed: Decimal.FormatStyle.Attributed { get }
var locale: Locale
var parseStrategy: Decimal.ParseStrategy<Decimal.FormatStyle.Percent> { get }
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Decimal)?
func decimalSeparator(strategy: Decimal.FormatStyle.Percent.Configuration.DecimalSeparatorDisplayStrategy) -> Decimal.FormatStyle.Percent
func format(_ value: Decimal) -> String
func grouping(_ group: Decimal.FormatStyle.Percent.Configuration.Grouping) -> Decimal.FormatStyle.Percent
func locale(_ locale: Locale) -> Decimal.FormatStyle.Percent
func notation(_ notation: Decimal.FormatStyle.Percent.Configuration.Notation) -> Decimal.FormatStyle.Percent
func precision(_ p: Decimal.FormatStyle.Percent.Configuration.Precision) -> Decimal.FormatStyle.Percent
func rounded(rule: Decimal.FormatStyle.Percent.Configuration.RoundingRule = .toNearestOrEven, increment: Int? = nil) -> Decimal.FormatStyle.Percent
func scale(_ multiplicand: Double) -> Decimal.FormatStyle.Percent
func sign(strategy: Decimal.FormatStyle.Percent.Configuration.SignDisplayStrategy) -> Decimal.FormatStyle.Percent
typealias Configuration = NumberFormatStyleConfiguration
typealias RegexOutput = Decimal
static var percent: Decimal.FormatStyle.Percent { get }
static var percent: Decimal.FormatStyle.Percent { get }
static func currency<Value>(code: String) -> Self where Self == FloatingPointFormatStyle<Value>.Currency, Value : BinaryFloatingPoint
static func currency<V>(code: String) -> Self where Self == IntegerFormatStyle<V>.Currency, V : BinaryInteger
static func list<MemberStyle, Base>(memberStyle: MemberStyle, type: ListFormatStyle<MemberStyle, Base>.ListType, width: ListFormatStyle<MemberStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<MemberStyle, Base>, MemberStyle : FormatStyle, Base : Sequence, MemberStyle.FormatInput == Base.Element, MemberStyle.FormatOutput == String
static func list<Base>(type: ListFormatStyle<StringStyle, Base>.ListType, width: ListFormatStyle<StringStyle, Base>.Width = .standard) -> Self where Self == ListFormatStyle<StringStyle, Base>, Base : Sequence, Base.Element == String
var regex: Regex<Self.RegexOutput> { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.