Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS

Reply
 
Thread Tools Display Modes
Old 07-14-2015, 08:26 AM   #1
DaltonS
 
DaltonS's Avatar
 
Join Date: Aug 2004
Location: Hamilton, Ont. CANADA
Default FWIW: A Significant Formula for GURPS Spreadsheets

It is traditional in GURPS to round the final value of most calculations to 2 significant digits. While I have not been able to find a built-in function to do this in the (OpenOffice) spreadsheets I use, the following formula works fine to display values to that precision.
Code:
=ROUND(J8;IF(J8=0;0;INT(2-LOG10(ABS(J8)))))
where “J8” is the cell containing the raw value of the calculation. For other levels of precision, change the “2” in the formula to the number of significant digits you wish to use, or to a cell reference containing that value.
Dalton “who prefers 3 digits himself, but I'm not the Secret Masters Spence
DaltonS is offline   Reply With Quote
Old 07-14-2015, 10:26 PM   #2
Peter Knutsen
Banned
 
Join Date: Oct 2007
Location: Europe
Default Re: FWIW: A Significant Formula for GURPS Spreadsheets

Odd. I'd be very surprised if Libre Office (a fork off Open Office, that's apparently preferred by many, for reasons I no longer remember, but which I've switched over to myself) can't round to significant digits.
Peter Knutsen is offline   Reply With Quote
Old 07-15-2015, 09:48 AM   #3
Phantasm
 
Phantasm's Avatar
 
Join Date: Jun 2006
Location: On the road again...
Default Re: FWIW: A Significant Formula for GURPS Spreadsheets

Quote:
Originally Posted by Peter Knutsen View Post
Odd. I'd be very surprised if Libre Office (a fork off Open Office, that's apparently preferred by many, for reasons I no longer remember, but which I've switched over to myself) can't round to significant digits.
Mine can, but what I think the formula does is handle the case that "23,530" needs to round to "24,000" while "2.353" needs to round to "2.4" in the same cell for calculations. Manually adjusting the "X" in "=ROUND(blah;X)" every time can get tedious, since the -2 in =ROUND(23530;-2) is just offsetting from the decimal.
__________________
"Life ... is an Oreo cookie." - J'onn J'onzz, 1991

"But mom, I don't wanna go back in the dungeon!"

The GURPS Marvel Universe Reboot Project A-G, H-R, and S-Z, and its not-a-wiki-really web adaptation.
Ranoc, a Muskets-and-Magery Renaissance Fantasy Setting
Phantasm is offline   Reply With Quote
Old 07-15-2015, 12:17 PM   #4
weby
 
weby's Avatar
 
Join Date: Oct 2008
Default Re: FWIW: A Significant Formula for GURPS Spreadsheets

Quote:
Originally Posted by tbrock1031 View Post
Mine can, but what I think the formula does is handle the case that "23,530" needs to round to "24,000" while "2.353" needs to round to "2.4" in the same cell for calculations. Manually adjusting the "X" in "=ROUND(blah;X)" every time can get tedious, since the -2 in =ROUND(23530;-2) is just offsetting from the decimal.
Correct, that is why the formula DaltonS posted (or the variant based on LEN instead of LOG 10) has been used for many thing a long time in spreadsheets..
weby is offline   Reply With Quote
Old 07-15-2015, 03:33 PM   #5
Humabout
 
Humabout's Avatar
 
Join Date: Aug 2008
Default Re: FWIW: A Significant Formula for GURPS Spreadsheets

Yeah, I usually use ROUND(VALUE,SIGFIG-LEN(INT(VALUE))), myself. IIRC, someties you need an IF to sort out VALUEs less than 1, but otherwise its pretty simple.
__________________
Buy My Stuff!

Free Stuff:
Dungeon Action!
Totem Spirits

My Blog: Above the Flatline.
Humabout is offline   Reply With Quote
Reply

Tags
gurps, spreadsheet

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:51 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.