The Round function

amauer

New Member
Joined
May 11, 2012
Messages
33
Hello,
I have a PDF mail merge job that pulls values (currency with 4+ decimal places) from an Excel spreed sheet (.xls). I am using the Round() function to reduce the decimal places to 2. The number is then moved to a text box on a PDF form. All cells and text boxes (in pdf) are set to 2 decimal places, but the values on the pdf text boxes show 4 decimal places. The pdf document divides one text box by 2 then subtracts another number. I end up (sometimes) with a very long decimal value.

Does the Round() function just change the apparent value and store the old value in the document?

</SPAN>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
This rounds a value to 2 decimal places:
=Round(A1,2)

In any case, my examples were only demonstrations of the round() function. I assumed (probably correctly) that the OP knows how to use the round() function and wouldn't need me to spell that out. It's a pretty basic thing really.

ξ


Note: if you don't agree with me, by all means provide a counter-demonstration to show that I am the one who is wrong. I suspect it's just a matter of terminology. By value I mean the raw value (the number). By format I mean how it looks.

In my last example:
  • 5.001 is one value. It can be formatted as 5, 5.00, 5.001
  • Round(5.001,2) is another value. It can be formatted as 5, 5.00, or 5.000. It can't be formatted as 5.001 though, because the value of round(5.001,2) is exactly 5.00.
 
Last edited:
Upvote 0
Xenou, I am not disagreeing with you, the OP wanted a number such as 45.3471 rounded(or altered or displayed) to 2 decimal places. My approach presumably does exactly what round does (add .005 then display to 2 decimal places). We do not know if later the OP will use the number again in further calculations, or whether 45.3471 or 45.35 would be used.

I am old and wise - I do not pick fights with moderators - but I am from UK.......
 
Upvote 0
And for my part, the OP asked:
Does the Round() function just change the apparent value and store the old value in the document?

which the question which is I answered.

In your posts, you are not employing Excel's ROUND() function for rounding operations. So that is the difference between our answers. I don't think there's a fight here. Were just not talking about the same thing. I wanted to answer the question about the round function, which I assume was about Excel's ROUND() function. If that was a mistaken assumption then I apologize to have confused you or anyone else and I hope this clears it up.

Feel free to fight with me - I don't mind.
ξ
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top