//
//  LSLDecimalNumberTool.m
//  Open
//
//  Created by 雷俊博 on 2020/5/7.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "LSLDecimalNumberTool.h"

@implementation LSLDecimalNumberTool

+ (float)floatWithdecimalNumber:(double)num {
    return [[self decimalNumber:num] floatValue];
}

+ (double)doubleWithdecimalNumber:(double)num {
    return [[self decimalNumber:num] doubleValue];
}

+ (NSString *)stringWithDecimalNumber:(double)num {
    return [[self decimalNumber:num] stringValue];
}

+ (NSDecimalNumber *)decimalNumber:(double)num {
    NSString *numString = [NSString stringWithFormat:@"%lf", num];
    return [NSDecimalNumber decimalNumberWithString:numString];
}


@end
