Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting decimals
#1
Good morning!

If I have a variable that is let’s say 2000.846

What would be the easiest way to convert the decimals to a specific number?

If above .75 convert to .50
If above .50 convert to .25
If above .25 convert to .00
Reply


Messages In This Thread
Converting decimals - by stylingpat - Mar-27-2021, 11:23 AM
RE: Converting decimals - by BashBedlam - Mar-27-2021, 01:09 PM
RE: Converting decimals - by stylingpat - Mar-27-2021, 01:36 PM
RE: Converting decimals - by deanhystad - Mar-27-2021, 02:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python won 't do decimals SomebodySmart 5 822 Jun-08-2023, 07:14 PM
Last Post: buran
  Get numpy ceil and floor value for nearest two decimals klllmmm 4 1,374 Jun-07-2023, 07:35 AM
Last Post: paul18fr
  Adding Decimals to classes with OOP + rounding to significant digits (ATM demo) Drone4four 7 2,419 May-04-2022, 06:15 AM
Last Post: Drone4four
  floats 2 decimals rwahdan 3 1,680 Dec-19-2021, 10:30 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020