Skip to content

Instantly share code, notes, and snippets.

View long-nguyen's full-sized avatar
💭
Happy to be an engineer!

NGUYEN TIEN LONG long-nguyen

💭
Happy to be an engineer!
  • Rakuten (株式会社楽天)
  • Tokyo
View GitHub Profile
@fjolnir
fjolnir / LENumberFormatter.h
Last active April 18, 2019 02:52
Abbreviates numbers like: 1234567 to 1m 234k 567, 1.23m, 123万4千5百67, 123.4万 etc..
@import Foundation;
typedef NS_ENUM(NSUInteger, LENumberFormatterAbbreviationStyle) {
kLEAbbreviateShort, // 2.5m
kLEAbbreviateNormal // 2m 5k
};
@interface LENumberFormatter : NSNumberFormatter
@property(nonatomic) BOOL abbreviateLargeNumbers;
@property(nonatomic) LENumberFormatterAbbreviationStyle abbreviationStyle;