Python Forum
Round off floats in a list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Round off floats in a list
#1
Hello!

I'm writing to ask how to round off the given list l = [0.0, 1.23, 1.68] so it reads as l = [0, 1, 1.5], with also having an option to round it off as l = [0, 1, 2].

Thank you!
Reply


Messages In This Thread
Round off floats in a list - by nagymusic - Mar-30-2019, 01:37 PM
RE: Round off floats in a list - by Larz60+ - Mar-30-2019, 02:26 PM
RE: Round off floats in a list - by nagymusic - Mar-30-2019, 02:49 PM
RE: Round off floats in a list - by micseydel - Mar-30-2019, 07:04 PM
RE: Round off floats in a list - by nagymusic - Mar-31-2019, 05:59 PM
RE: Round off floats in a list - by Larz60+ - Mar-31-2019, 07:58 PM
RE: Round off floats in a list - by nagymusic - Apr-01-2019, 01:07 AM
RE: Round off floats in a list - by Larz60+ - Apr-01-2019, 01:45 AM
RE: Round off floats in a list - by nagymusic - Apr-01-2019, 12:05 PM
RE: Round off floats in a list - by nilamo - Apr-01-2019, 07:43 PM
RE: Round off floats in a list - by nagymusic - Apr-02-2019, 12:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to round this code without getting an error? wlsa 2 2,439 Jun-30-2018, 07:57 PM
Last Post: ljmetzger
  def functions and floats alwillia 3 4,452 May-26-2018, 07:31 PM
Last Post: buran
  I need help with floats and int calloflegend11 4 3,829 Aug-27-2017, 10:29 PM
Last Post: BerlingSwe

Forum Jump:

User Panel Messages

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