[Gambas-user] Need help on format$ function
Bodard Fabien
gambasfr at ...11...
Sat Nov 27 19:06:09 CET 2004
Le samedi 27 Novembre 2004 15:53, Christian Faure a écrit :
> El Viernes, 26 de Noviembre de 2004 16:14, Bodard Fabien escribió:
> > 12355.20
>
> Hi,
> i think format() not support requested format,
> divide into its components:
>
> PUBLIC FUNCTION format_hl(x AS Variant ) AS String
> DIM hl AS Variant
> DIM l AS Variant
> DIM cl AS Variant
> DIM out AS String
>
> x=Round(x,-2)
> hl=Int(x/100)
> l=Int(x-hl*100)
> cl = Frac(x)*100
>
> out=Format(hl,"#,##0hl") 'hl
> out=out &" " & Format(l,"#,##0l") 'l
> out=out &" " & Format(cl,"00cl") 'cl
> RETURN out
> END
>
> PUBLIC SUB Button1_Click()
> PRINT format_hl(12355.999)
> END
>
>
Thank Christian
hum yes ... it's a workaround... but not a finallity. I don't know how to
implement that into gambas... but It will be really usefull i think...
isn't it benoit?
Fabien Bodard
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list