.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old October 16th, 2005, 07:47 PM

wilhil wilhil is offline
Sergeant
 
Join Date: Sep 2003
Posts: 258
Thanks: 0
Thanked 0 Times in 0 Posts
wilhil is on a distinguished road
Default quick excel help needed, and a treat very soon!

Hi

I am about to release a file that should help alot of you with your game and upgrades, to myknowledge there is not one like it here.

there is one thing I can not figure out, I have not been using excel in some time, anyway, how do I get rid of the decimal point and following figures in a cell but not make it round up?

I understand how to do it normally, but 1.9 will become 2, and I really need even 1.99999 to become 1, as it must be a whole number only.

can anyone help me here?

Thanks
Reply With Quote
  #2  
Old October 16th, 2005, 07:53 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

TRUNC chops off the decimals.
INT rounds down.
There's a subtle difference, in that -2.5 will TRUNC to -2, but INT to -3.
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #3  
Old October 16th, 2005, 07:59 PM

wilhil wilhil is offline
Sergeant
 
Join Date: Sep 2003
Posts: 258
Thanks: 0
Thanked 0 Times in 0 Posts
wilhil is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

Thanks!

when you say about negative numbers, is that just for negatives, so 2.5 ints and truncs to 2, whilst 2.6 will int to 3 whilst trunc is 2?

if I get what you are saying, trunc is what I am looking for! thanks (int is not needed now, but useful to know! I have not really been going through the functions! but this is good!)
Reply With Quote
  #4  
Old October 16th, 2005, 08:13 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

Not quite... 2.6 would also int to 2, because int rounds *down* no matter what. But that doesn't seem to be what you need, so that doesn't matter
What is this spreadsheet you're working on anyway? You said it had to do with the "game and upgrades" - do you mean modding families of components and such? If so I'd really love to see it... somehow I can't make myself use an *old* version of the templatizer, since I lost the latest version!
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #5  
Old October 16th, 2005, 08:24 PM
Slick's Avatar

Slick Slick is offline
Brigadier General
 
Join Date: Apr 2002
Location: Kailua, Hawaii
Posts: 1,860
Thanks: 0
Thanked 1 Time in 1 Post
Slick is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

if you want to round in the traditional sense, add 0.5 then trunc.
__________________
Slick.
Reply With Quote
  #6  
Old October 16th, 2005, 09:08 PM

wilhil wilhil is offline
Sergeant
 
Join Date: Sep 2003
Posts: 258
Thanks: 0
Thanked 0 Times in 0 Posts
wilhil is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

here is what I was making

http://www.shrapnelcommunity.com/thr...b=5&o=&fpart=1

I hope you enjoy, also, what is templatizer? is it something SE or general excel related?

and I dont get int then! is the only diffrence between int and trunc when you have negative numbers?

I havent done any good maths in years! and thank you trunc worked!
Reply With Quote
  #7  
Old October 16th, 2005, 10:20 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

The templatizer is a program I wrote which would take a "template" file containing formulas for component families and such and convert it into a full-fledged SE4 data file. The latest version is version 4.0.0, but unfortunately that version was lost, and the previous version, version 3.0.5, is a bit of a pain to get running in Windows, as it relies on a GNU C mathematical library to run. (Previous versions used my own mathematical library, which was very buggy; version 4 used a Java mathematical library. I started working on a version 5 which would have had a graphical user interface, but gave up on that ) I think I might still have version 3.0.5 (or at least some version near it) at school, though...
Of course, the templatizer will hopefully be rendered obsolete when SE5 comes out, as we're supposed to have formula parsing integrated directly into the data files
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #8  
Old October 17th, 2005, 12:56 AM
Will's Avatar

Will Will is offline
Lieutenant Colonel
 
Join Date: Mar 2001
Location: Emeryville, CA
Posts: 1,412
Thanks: 0
Thanked 0 Times in 0 Posts
Will is on a distinguished road
Default Re: quick excel help needed, and a treat very soon

The point of INT is to be used as a FLOOR() function, which returns the next-lowest integer value for real number input (if the input is an integer, the function returns the input). TRUNC on the other hand, just takes any real number, and removes any decimal digits that it may have.

So yes, for positive real numbers, there is no difference between the results of INT and TRUNC. And for negative real numbers, there is no difference between CIEL and TRUNC. But there are uses for all three.
__________________
GEEK CODE V.3.12: GCS/E d-- s: a-- C++ US+ P+ L++ E--- W+++ N+ !o? K- w-- !O M++ V? PS+ PE Y+ PGP t- 5++ X R !tv-- b+++ DI++ D+ G+ e+++ h !r*-- y?
SE4 CODE: A-- Se+++* GdY $?/++ Fr! C++* Css Sf Ai Au- M+ MpN S Ss- RV Pw- Fq-- Nd Rp+ G- Mm++ Bb@ Tcp- L+
Reply With Quote
Reply

Bookmarks

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
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 10:28 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.