//
//  NumberFormatterAxisValueFormatter.m
//  react-native-charts
//
//  Created by Peter Vu on 16/03/2023.
//

#import <Foundation/Foundation.h>
#import "RNCharts-Swift.h"
#import "NumberFormatterAxisValueFormatter.h"
#import "NSNumberFormatter+Abbreviation.h"

@implementation NumberFormatterAxisValueFormatter

- (NSString *)stringForValue:(double)value axis:(ChartAxisBase *)axis {
	NSInteger integerValue = (NSInteger)value;
	NSNumberFormatter *numberFormatter = [NSNumberFormatter abbreviationFormatterForNumber:integerValue];
	NSString *formattedValue = [numberFormatter stringFromNumber:@(value)];
	return formattedValue;
}

@end

