Re: Comparison Issue

Daniel Dekany <[email protected]> Wed, 27 Jan 2016 22:33:22 +0100
Newsgroups gmane.comp.web.freemarker.devel
Message-ID <[email protected]>
That's good point, though ?length on a non-list(ish) value will give
an error instead of a non-2 value.


Wednesday, January 27, 2016, 9:51:14 PM, Lee wrote:

> What kind of data type is record.quantity?
>
> If record.quantity is a list (array), use <#if record.quantity?size
> == 2>
> (http://freemarker.incubator.apache.org/docs/ref_builtins_sequence.html#ref_builtin_size)
>
> If record.quantity is a string, use <#if record.quantity?length == 2>
>
> If record.quantity is an integer, use <#if record.quantity == 2>
>
> On Wed, Jan 27, 2016 at 11:46 AM, Daniel Dekany <[email protected]> wrote:
> It should work like that, so the only thing I can think of is that the
> length is indeed not 2.
>
> BTW, this mailing list has been retired months ago. There's
> [email protected] instead (see
> http://freemarker.incubator.apache.org/mailing-lists.html). Where did
> you find the old address?
>
> --
> Thanks,
>  Daniel Dekany
>
>
> Wednesday, January 27, 2016, 6:01:31 PM, MG 2016 wrote:
>
>> Hi There,
>>
>> I started using the Free Marker today.
>>
>>         <#if record.quantity?length == 2>
>>
>> The above seems to be false. When I switch this to !=2 it seems to be OK. I
>> just want to show a bit of text when the quantity is 2
>>
>> What I'm I doing incorrectly?
>>
>>
>>
>> --
>> View this message in context:
>> http://freemarker.624813.n4.nabble.com/Comparison-Issue-tp4655606.html
>> Sent from the freemarker-devel mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> FreeMarker-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

-- 
Thanks,
 Daniel Dekany


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140