Inherits from NSObject
Declared in MMPresentationFormatter.h
MMPresentationFormatter.m

Overview

  • A helper class that can format

  • model data into something suitable

  • for the UI.

Class Methods

formatBusinessHoursForOpenTime:withCloseTime:

  • Formats a merchant’s business hours in
+ (NSString *)formatBusinessHoursForOpenTime:(NSString *)openTime withCloseTime:(NSString *)closeTime

Discussion

  • an appropriate format.

*

  • @param openTime The open-time of a merchant.

  • @param closeTime The close-time of a merchant.

*

  • @return A UI appropriate string that represents

  •    a merchant's business hours.
    

Declared In

MMPresentationFormatter.h

formatDistance:

  • Returns a string which represens a distance
+ (NSString *)formatDistance:(NSNumber *)distance

Discussion

  • in a UI appropriate format. If a distance

  • is under 1.0 km, the distance is formatted

  • in metres; if greater that or equal to 1.0 km,

  • the distance is formatted in kilometers.

*

  • @param distance A distance

*

  • @return A UI formatted representation of

  •    a distance.
    

Declared In

MMPresentationFormatter.h

formatNumberAsPrice:

  • Provides a UI appropriate formatting
+ (NSString *)formatNumberAsPrice:(NSNumber *)price

Discussion

  • for a model’s price.

*

  • @param price A price.

*

  • @return A UI appropriate string that represents

  •    a model's price.
    

Declared In

MMPresentationFormatter.h

formatRatingForRawRating:

+ (NSString *)formatRatingForRawRating:(NSNumber *)rating

Discussion

  • MMMenuItem and formats the number as

  • with 2 significant digits. A rating of

  • 0 is formatted an ‘N/A’

*

  • @param rating The rating from the model.

*

  • @return A string formatted representation of

  •    the rating.
    

Declared In

MMPresentationFormatter.h