package com.cheng.blzb.ext

import java.math.BigDecimal
import java.math.RoundingMode

fun String.format(newScale: Int = 2, roundingMode: RoundingMode = RoundingMode.HALF_UP): BigDecimal {
    val bd = BigDecimal(this)
    return bd.setScale(newScale, roundingMode)
}