init(tollAmount:locale:)
Creates additional route information for a toll amount.
Declaration
convenience init(tollAmount value: Double, locale: Locale)Parameters
- value:
The toll amount as a decimal value (e.g., 5.50 for $5.50)
- locale:
The locale to use for currency formatting. The locale’s currency code determines the currency symbol and formatting rules. Pass @c [NSLocale currentLocale] to use the user’s preferred locale, or create a specific locale for fixed currency display.
Return Value
A new @c CPRouteDetail instance representing the toll amount
Discussion
Use this method to display toll costs associated with a route. The toll amount will be formatted according to the provided locale’s currency settings.
Toll information helps users make informed routing decisions, particularly when comparing routes with varying toll costs. The system automatically formats the value using the locale’s currency symbol, decimal separator, and digit grouping conventions.