Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2008

Tip: Looking for answers? Try searching our database.

Rounding non-integers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
me - 04 Mar 2008 18:14 GMT
OK, so I'm working in Infopath 2007.

Is there a way, without custom code, to round a number to say two decimal
places?

I've got a field (A) that is set to be a two decimal place number.  When I
run a formula and store the result there, it rounds and displays the number
properly.  BUT if I then try to use field (A) in another calculation, the
calculation is using the actual value in (A) vice what is displayed.

Hopefully I explained that clearly.

In Excel, I can "roundup" any number, and specify how many decimal places I
want.  What gives Infopath?!?!?!

Thanks for any guidance (even if I have to use code).

--me
Clay Fox - 04 Mar 2008 22:15 GMT
You could probably use substring functions to truncate your decimal places.

Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

>     OK, so I'm working in Infopath 2007.
>
[quoted text clipped - 14 lines]
>
> --me
Greg Collins - 04 Mar 2008 22:52 GMT
round(my:number * 100) / 100

Signature

Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com

Clay Fox - 04 Mar 2008 22:58 GMT
Cool, much more eloquent!

Thanks Greg.
Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> round(my:number * 100) / 100

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.