View Active Threads
View Today's Posts
Home
Forums
View New Posts
View Today's Posts
My Discussions
Unanswered Posts
Unread Posts
Active Threads
Mark all forums read
Staff List
Member List
Help
Calendar
Search
Statistics
Interpreter
IRC
Rounding to the nearest eight
Python Forum
Python Coding
General Coding Help
Thread Rating:
0 Vote(s) - 0 Average
1
2
3
4
5
Thread Modes
Rounding to the nearest eight
wallgraffiti
Programmer named Tim
Posts:
11
Threads:
8
Joined:
Jul 2020
Reputation:
0
#1
Jul-15-2020, 05:30 PM
Basically, I just need to round a number to the nearest eight and by my research the
round()
function cannot do that.
Reply
Find
Reply
bowlofred
Da Bishop
Posts:
1,566
Threads:
3
Joined:
Mar 2020
Reputation:
165
#2
Jul-15-2020, 05:36 PM
Divide by 8, round(), multiply by 8.
>>> round(3.9 / 8) * 8 0 >>> round(4.1 / 8) * 8 8
Reply
Find
Reply
wallgraffiti
Programmer named Tim
Posts:
11
Threads:
8
Joined:
Jul 2020
Reputation:
0
#3
Jul-15-2020, 06:05 PM
Thanks! That worked.
Reply
Find
Reply
Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
Writing a cycle to find the nearest point from the array
Tysrusko
0
184
May-10-2024, 11:49 AM
Last Post
:
Tysrusko
Get numpy ceil and floor value for nearest two decimals
klllmmm
4
1,355
Jun-07-2023, 07:35 AM
Last Post
:
paul18fr
need help rounding
joseph202020
7
1,409
Feb-21-2023, 08:13 PM
Last Post
:
joseph202020
compare and find the nearest element ?
mr_gentle_sausage
4
1,114
Jan-15-2023, 07:11 AM
Last Post
:
DPaul
from numpy array to csv - rounding
SchroedingersLion
6
2,309
Nov-14-2022, 09:09 PM
Last Post
:
deanhystad
Random data generation sum to 1 by rounding
juniorcoder
9
3,576
Oct-20-2021, 03:36 PM
Last Post
:
deanhystad
Rounding issue
kmll
1
1,459
Oct-08-2021, 10:35 AM
Last Post
:
Yoriz
Not rounding to desired decimal places?
pprod
2
2,613
Mar-05-2021, 11:11 AM
Last Post
:
pprod
Decimal Rounding error
project_science
4
2,824
Jan-06-2021, 03:14 PM
Last Post
:
project_science
rounding and floats
Than999
2
3,170
Oct-26-2020, 09:36 PM
Last Post
:
deanhystad
Users browsing this thread: 1 Guest(s)
View a Printable Version
Forum Jump:
Private Messages
User Control Panel
Who's Online
Search
Forum Home
Python Coding
-- General Coding Help
-- Data Science
-- Homework
-- GUI
-- Game Development
-- Networking
-- Web Scraping & Web Development
General
-- News and Discussions
-- Tutorials
---- Tutorial Requests and Submissions
---- Python Installation and Execution
---- Fundamentals
---- Common pitfalls and what to do
---- Web Scraping
---- Web Tutorials
---- GUI tutorials
---- Game Tutorials
---- Networking Tutorials
-- Code sharing
-- Code Review
-- Jobs
Forum & Off Topic
-- Board
---- Weekly Top Picks
-- Bar
User Panel
Messages
Log Out
My Profile
Pay your profile a visit
User Control Panel
Do some changes on your profile
My Messages
View private messages
unread
Avatar
Change avatar
Signature
Change signature
Announcements
Announcement #1
8/1/2020
Announcement #2
8/2/2020
Announcement #3
8/6/2020
Login to Python Forum
Enter your details to login to your account:
Remember me
Lost Password?
Login
Don't have an account yet?
Sign Up!
Linear Mode
Threaded Mode