[Pas2js] My 1st type helper

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Mar 1 00:23:39 CET 2019


On Thu, 28 Feb 2019 04:45:28 -0700 (MST)
warleyalex via Pas2js <pas2js at lists.freepascal.org> wrote:

> we have to create an intermediate variable "s" to work as expected.
> 
> var
>   ReturnValue : Float;
>   s: string;
> begin
>   ReturnValue := 2.71;
> 
>   ReturnValue:= ReturnValue * ReturnValue.NPI;
>   s:= ReturnValue.ToStr;
>   console.log(s);  // 8.51371432 
> ------
> but we can't use it straightforward like
> 
> //  console.log((ReturnValue *
> ReturnValue.NPI).ToStr);    //8.51371432

Fixed.

Mattias


More information about the Pas2js mailing list