Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2015 12:14:05 -0400
From:      "Mike." <the.lists@mgm51.com>
To:        freebsd-questions@freebsd.org
Subject:   dc - syntax question
Message-ID:  <201504241214050065.0096CC46@smtp.24cl.home>

next in thread | raw e-mail | index | archive | help
(FreeBSD 10.1)

I've been staring at this for a bit, trying to understand what I'm
doing incorrectly.  Maybe I'm blinded to my error because I'm too
close to it.  In any case....


I have an expression that I want to use dc to evaluate.  I want zero
decimal places in the answer.   I've simplified my more complex
expression down to something simple.


	# dc -e "100 .333 *  p"
	33.300


I'd like to see 33 as the answer, not 33.300

So I then tried

	# dc -e "100 .333 * 0k  p"

and I still got 33.300 as the answer.

I had thought that the "0k" would result in a precision of zero,
i.e., zero decimal places in the answer.

Where have I gone astray?  

thanks.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504241214050065.0096CC46>