Cody Bable

Generation

generate functionThu, 20 Apr 2023

place 2 decimal places

def truncate(number, places=2): return number[:places + 1] truncate(1.234, 1)

Questions about programming?Chat with your personal AI assistant