How to round value with no precision for only a specific fie

Help is preferred to those who publish their work as Open Source and not as private branches rejecting collaboration. Such projects are not maintainable and shall be deleted.
Forum rules
This forum is personally pruned to avoid redundant posts. Related topics are grouped together. IF YOU HAVE REGISTERED, you need to send email to red1(a)red1.org with your username in the subject title to get me to activate you.

How to round value with no precision for only a specific fie

Postby vivekjustthink » Fri Oct 19, 2012 8:07 pm

Hi,

I have a field "Grand Total". It's reference in Table & Column is "Amount". Currently its precision is 2. Where should i change the precision so that the value is rounded to 1 precision or 0 precision. Please help me out. Thank You!!

regards
vivek
vivekjustthink
 
Posts: 21
Joined: Thu Oct 04, 2012 5:32 pm

Re: How to round value with no precision for only a specific

Postby globalqss » Fri Oct 19, 2012 9:14 pm

Hi Vivek, amount uses the precision of the currency, for zero precision you can use integer, for more precision you can use Qty.

I don't think there's an easy way to force precision of 1.

Regards,

Carlos Ruiz
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia

Re: How to round value with no precision for only a specific

Postby vivekjustthink » Sat Oct 20, 2012 2:19 pm

Hi gloabalqss,

Thanks for your valuable information. Your info was very useful for me. But there is a problem when using integer. The actual value is 1178.76. when i change it to integer it shows 1178. i want it to 1179. i.e the value has to be rounded. This rounding is not done in case of integer.

Thank You
vivek
vivekjustthink
 
Posts: 21
Joined: Thu Oct 04, 2012 5:32 pm

Re: How to round value with no precision for only a specific

Postby globalqss » Sat Oct 20, 2012 10:59 pm

Well - in such case I would go to a ModelValidator before save event on that table and round the value.

Regards,

Carlos Ruiz
globalqss
Senior
 
Posts: 599
Joined: Thu Dec 29, 2005 4:15 am
Location: Bogotá, Colombia


Return to HELP ME!!!

Who is online

Users browsing this forum: No registered users and 3 guests