Jump to content

This topic is 7754 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I am a school teacher using fm to figure class grades. I keep a gradebook in fm and I use the grades in my report card which is also written in fm. When it inserts the homework average into the report card the number is represented as 95.876543, but I want it to be 96. 95.876543 looks terrible. How do I adjust this? Please help, i have to turn in my reports tomorrow! confused.gif

Posted

Hi fmteacher,

Actually, the calculation Lee provided with give you 95.88 on 95.876543.

The number in the Round() function is how many decimals to include in the Round() calculation (and display). Also, Round() always rounds up by .5. If you want to end up with 96, just use Round(YourNumber, 0). But do you really always want to round up? What about 95.0001?

If you want a true round (up or down) you need to include Int(), ie, 95.44 will become 95 but 95.876543 will become 96.

Int(Round(YourNumber,0)) will produce a whole number.

95.5 is the break point and will become 96 as it should be - particularly on grades! smile.gif

If you need help on how to enclose your field in this, let us know. Just place your number field where it says 'YourNumber'.

LaRetta

Posted

Here is my calculation field. i added the Int(Round, 0)). Total possible homework is the total worth of all of their assignments. I'm still getting 95.65432 as it appears in my report. What now?

Sum(diary 1, diary 2, diary 3, twenty three four, twenty three org., twenty four one, span war map, war org) /Int(Round(total possible hw,0)) * 100

Posted

Hi fmteacher,

The most difficult part in this scenario is determining exactly what you need. Everyone has a different idea of how numbers should be rounded (or handled). Just think through exactly what you want ... up or down ... and how far out (how many decimals) you want to take into account.

For instance, Truncate is the ultimate whole-number 'round down' because it just drops all decimals and leaves the whole number. But, by itself, it won't work if you also want to round up.

Using Truncate(Round(number,0), 0) will give you the same result as Int(Round(number, 0) but the second is shorter. smile.gif

LaRetta

Posted

Int(Round(Sum(diary 1, diary 2, diary 3, twenty three four, twenty three org., twenty four one, span war map, war org) /Int(Round(total possible hw,0)) * 100, 0)) -- wrap it around your entire calculation.

Posted

Whoa! Let's back up! I just looked at your calculation! Wow. Your calc isn't making sense! Give it to me straight - without the Int in it - before you started trying to IMPROVE upon it. smile.gif

Posted

Thanks for your help LaRetta

This calculation does get me a number, a number with too many decimals if it happens to have any. diary 1, diary 2 are assignments that the kids did and each assignment gets graded and has a numerical value. I total all the assignments up, divide by the total possible, multiply by 100 and get a number, like 95 or 100 or 89.76543. My report card pulls this field from the grade book into the report. I dont mind the decimals in the grade book, but they look awful in the written report that gets sent home to parents. Any other thoughts?

Sum(diary 1, diary 2, diary 3, twenty three four, twenty three org., twenty four one, span war map, war org) /total possible hw * 100 confused.gif

Posted

Hi fmteacher,

Okay, now your calc makes sense. The way you listed it before - with /Int(Round) in the middle - was incorrect - as you found out and your calculation didn't make sense!

Take your WHOLE calculation and wrap it with:

Int(Round(

Sum(diary 1, diary 2, diary 3, twenty three four, twenty three org., twenty four one, span war map, war org) /total possible hw * 100

, 0))

That will work. Also, from Layout mode, select the field and right-click, then Field Format and Number format and make sure it is set to General Format - not decimals. I think we've got it now. smile.gif

LaRetta

Posted

Now go pour yourself a glass of Merlot, put your feet up and relax! You've done enough for the kids tonight. smile.gif And you are most welcome. smile.gif

LaRetta

Posted

LaRetta, the function you gave:

Int(Round(Number,0))

will produce exactly the same result as:

Round(Number,0)

The Round() function rounds up or down depending on the fractional part.

Fractional part >= .5 rounds up

Fractional part < .5 rounds down

Posted

Hi Bob smile.gif

Good grief! I've reverted! A year ago, I thought FM Help said it rounded up by .5 and it says at .5. Since then, I've tested it and I've used it many times to round down. I even posted that it rounded up AND down just a few months ago. And tonight, I forgot again... crazy.gif

Egg on face! I guess I'm due for a break. Thank you so much Bob, for setting me straight. grin.gif

So sorry fmteacher. Drop the Int() but keep the Merlot.

LaRetta

Posted

In the case where you need a custom round I use the following, puts you in total control.

The calculated field is:

If(Mod(WorkingNumber, 1) ? Threshold, Truncate(WorkingNumber, 0)+1, Truncate(WorkingNumber, 0))

Where threshold is a global containing the decimal threshold,

and workingnumber is the raw number

Rod

This topic is 7754 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.