S
S
Salim2021-07-28 01:25:47
Python
Salim, 2021-07-28 01:25:47

How to remove multiple digits from a number?

Good afternoon, without using round, how can I make sure that when entering a fractional number, the last digits after the decimal fraction are deleted? For example, the number 23.2456 is necessary so that only 23.24 remains

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ramis, 2021-07-28
@saver116

a = 23.2456
print(f'{a:.2f}')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question