You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Li Xiaoli-a17351 <a1...@motorola.com> on 2001/06/04 10:49:53 UTC

decimal in VTL

Hi 

My question is how VTL use decimal. I just input
#set($foo = 6.1)
in app_example1\example.vm, while compile, it shows "Encountered: "1" (49), after : "."", so how to assign a decimal to a variable in VTL?

Thank
Charley



Re: decimal in VTL

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/4/01 1:49 AM, "Li Xiaoli-a17351" <a1...@motorola.com> wrote:

> Hi 
> 
> My question is how VTL use decimal. I just input
> #set($foo = 6.1)
> in app_example1\example.vm, while compile, it shows "Encountered: "1" (49),
> after : "."", so how to assign a decimal to a variable in VTL?
> 
> Thank
> Charley
> 
> 

#set ($foo = "6.1")

You can't do Floats...only Integers. If you want to be able to do floats,
stick a helper object into the context.

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Balmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>