system
June 24, 2016, 1:18pm
1
Hi,
Thank you for your assistance; I’m looking to format this formula so that it does NOT return a decimal point. Currently, it returns numbers like 25.0
I need just the 25
IF{cr_invoice;1.TYPE}=“ORDER” THEN CStr(DatePart(“ww”,{cr_invoice;1.INVOICE_DT}, crMonday))
ELSE " "
camper66 (BOB member since 2016-06-24)
system
June 26, 2016, 10:21pm
2
The formula itself is not really the place to do that. Instead, right mouse click on the formula where it appears on the report canvas, select “format”, select the number tab and you should be able to change the decimal places, etc from there.
what’stheplandan (BOB member since 2016-03-07)
system
June 27, 2016, 5:35pm
3
Thank you for the suggestion, however the “number” option is not available for this element, which is why I thought it needed to be done through the formula.
camper66 (BOB member since 2016-06-24)
system
June 27, 2016, 6:23pm
4
It appears that it is a string. One way to do it is to use the left and instr functions.
i.e., left({somefield},instr({somefield},’.’)-1)
kevlray (BOB member since 2010-06-23)
system
June 27, 2016, 10:44pm
5
Just looked at your formula again (sorry, should have looked closer the first time). There are two ways to go:
If you remove the CStr function you will return a number (and then my original suggestion will work).
If you want a string returned, change the first line of your formula to:
IF{cr_invoice;1.TYPE}=“ORDER” THEN CStr(DatePart(“ww”,{cr_invoice;1.INVOICE_DT}, crMonday),“0” )
This will format that number with no decimal places.
what’stheplandan (BOB member since 2016-03-07)
system
June 29, 2016, 2:51pm
6
Thanks very much mate
camper66 (BOB member since 2016-06-24)