View Single Post
Old 03-28-2013, 02:58 AM   #1
oelgamal
Junior Member
oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.oelgamal once ate a cherry pie in a record 7 seconds.
 
Posts: 3
Karma: 1806
Join Date: Mar 2013
Device: laptop
Post Rounding to nearest integer in Custom Column - Hijri Year

Hello,

I have a column for the year the book was written in the Gregorian calendar, and also another column for the year in the Hijri Lunar calendar

I called the first column gyear, and the second column hyear. they are related by the simple formula hyear = (33/32)*(gyear - 622)

So made a column built from other columns, and called it hyear and gave it the following template,

Quote:
{#hyear:'multiply(divide(33,32),subtract(field('#g year'),622))'}
and it works fine, except the result is a float with 4 decimal places, and I want to round it to the nearest integer. I tried

Quote:
{#hyear:'format_number(multiply(divide(33,32),subt ract(field('#gyear'),622)),'{0:d}')'}
to do this but it does not work, it simply shows blank.

Please let me know how to do this, I am sure it is a very simple feature I simply overlooked.

Thanks

Last edited by oelgamal; 03-28-2013 at 02:53 PM. Reason: added formula
oelgamal is offline   Reply With Quote