Hi guys,
I’m playing with basic level uno code and i write a tiny expression class number formatter
[UXFunction("toFormat")]
public class ToFormat: BinaryOperator
{
[UXConstructor]
public ToFormat(
[UXParameter("V")] Fuse.Reactive.Expression v,
[UXParameter("F")] Fuse.Reactive.Expression f) :base(v,f)
{}
protected override object Compute(object v,object f)
{
return string.Format(f.ToString(),v);
}
}
usage
<JavaScript>
module.exports= {
moneyF:500000.5
};
</JavaScript>
<Text Value="{=toFormat({moneyF},'{0:N1}')}" />
and now a question uno have datetime parse and toString(format) ?