Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

08-14-2020 03:21 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

How can I do this rounding?

Solved! Go to Solution.

Highlighted
Options

08-14-2020 03:23 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Up if equal to 5**

Highlighted
Options

08-14-2020 05:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

NOTE: In both examples, Locals.Roundee is the number you want to round.

For your first examples

**Round**(Locals.Roundee,0)

For your second examples

**Val**(**Str**(Locals.Roundee, "%#.1f"))

Highlighted
Options
Doh! Just seen the "Up if 5" bit on your post. My examples will "Down if 5". I think if you want "Up if 5" that will be a pretty complicated statement.

08-14-2020 05:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Solution

Accepted by hkn10

08-14-2020 07:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@SercoSteveB wrote:

If you use 4 for the Round option, then it will use "banker's rounding" which will round 0.5 to the nearest even integer. So for the second example use

`Locals.Roundee = Round(Locals.Roundee*10,4)/10`

To multiply and divide by 10 are to shift the decimal point (or comma) to the left before the round (to round to the nearest 0.1) and to the right to undo the shift after the rounding.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines

"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5