def getRoundedToPlaces(decimalPlaces, number):
 decimalPlacesRounded = max(1, int(round(decimalPlaces)))
 return round(number, decimalPlacesRounded)

def getRoundedToPlaces ( decimalPlaces , number ) : decimalPlacesRounded = max ( 1 , int ( round ( decimalPlaces ) ) ) return round ( number , decimalPlacesRounded )
get number rounded to a number of decimal places .