Truncate

Kenneth Brody kenbrody at spamcop.net
Tue Nov 19 10:38:11 PST 2013


On 11/19/2013 11:24 AM, Matt Sherrill wrote:
> I’m sure this has come up before, but how do
> you truncate the decimals without FilePro rounding the number?
>
> I have 46949.500 that I need to round to the
> hundredth place (without the decimals).  So I want my result to
> show "46,900", not "47,000" - which is what is happening now.

Do you want it "without rounding the number" or "round to the hundredth place"?

Assuming you mean that you want to "truncate" (to the "hundreds", not 
"hundredth"), as implied by your subject, so that "46999.999" becomes 
"46900" (your example would have the same result whether "truncate" or "round"):

     result = number - mod(number,"100")

If this is not what you meant, please post a better description of what you 
need.

-- 
Kenneth Brody


More information about the Filepro-list mailing list