# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Number to Fractional String not using "round to even"?

For sanity check:

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 1 of 8
(230 Views)
Solution
Accepted by topic author billko

## Re: Number to Fractional String not using "round to even"?

Betcha it's the same basic problem as this recent thread.

Even though you typed "1.055", and the display format is set to only show 1.055, try expanding to 20 digits of precision...

-Kevin P

Message 2 of 8
(214 Views)

## Re: Number to Fractional String not using "round to even"?

Still yet, proper rounding ignores everything right of the significant digit.  If I say to round to two places, you should look no further than three.

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 3 of 8
(204 Views)

## Re: Number to Fractional String not using "round to even"?

@billko wrote:

Still yet, proper rounding ignores everything right of the significant digit.  If I say to round to two places, you should look no further than three.

e.g., 1.05509 should round to two digits the same as 1.05500.

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 8
(202 Views)
Highlighted

## Re: Number to Fractional String not using "round to even"?

That's also why I made the bottom branch of the code.  It shows how it gets rounded if the same digits get treated as a floating point value with just one decimal place and rounded using the rounding primitive.

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 8
(195 Views)
Solution
Accepted by topic author billko

## Re: Number to Fractional String not using "round to even"?

@billko wrote:

@billko wrote:

Still yet, proper rounding ignores everything right of the significant digit.  If I say to round to two places, you should look no further than three.

e.g., 1.05509 should round to two digits the same as 1.05500.

But going to 20 dig. precision, the number is 1.05499999999999994, thus round down to 1.05

Message 6 of 8
(189 Views)

## Re: Number to Fractional String not using "round to even"?

@RavensFan wrote:

@billko wrote:

@billko wrote:

Still yet, proper rounding ignores everything right of the significant digit.  If I say to round to two places, you should look no further than three.

e.g., 1.05509 should round to two digits the same as 1.05500.

But going to 20 dig. precision, the number is 1.05499999999999994, thus round down to 1.05

Ouch - that's awesome.  I thought it was going to be something like 1.05500000000001

Bill

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 8
(183 Views)

## Re: Number to Fractional String not using "round to even"?

@billko wrote:

Ouch - that's awesome.  I thought it was going to be something like 1.05500000000001

Sometimes those tails of the number will go that way.  Sometimes they are under.

Message 8 of 8
(177 Views)