#1 2018-09-20 23:08:42

jairgza
Member
Registered: 2015-01-15
Posts: 10

Mustache helper FormatFloat with ThousandSeparator

Im trying to create a mustache helper for FormatFloat:

  with _Safe(AValue)^ do
  if (Kind=dvArray) and (Count=2) and VariantToDouble(Values[0], lDob) then
  begin
    AResult := FormatFloat(Values[1],lDob);
  end
  else
    SetVariantNull(AResult);

This works with ej.  {{FloatFmt Number, "0.0000"}}

But fails with {{FloatFmt Number, ",0.0000"}}     AValue gets  [13450.1,"","0.0000\""] (3 values)  instead of  [13450.1, ",0.0000"](2 values)

The ThousandSeparator is a comma inside the string value but is treated like a separator for array values,  I try to escape de comma char {{FloatFmt Number, "\,0.0000"}} but not work

Could it be a bug extracting the values? or how can write the format string ?
Thanks

Offline

Board footer

Powered by FluxBB