If you are passing a value with floating point, do not use format %d
, it is used to whole, use %m
for monetary values or %n
for floating point values. Your code can look like this:
Format('%n', [Self.Owner.FieldByName('soma').AsFloat]);
Updating
According to the page Default Livebindings Methods the functioning of the function Format
is a little different when using Livebindings, instead of specifying a array of arguments [.., ...]
, is added as a parameter.
For example, the normal use of SysUtils.Format
it’s usually like this:
Format('%d %d', [1, 2])
In Livebindings one should use:
Format('%d %d', 1, 2)
Following this reasoning you can use:
Format('%n', Self.Owner.FieldByName('soma').AsFloat);
I’ll test and report.
– edmjunio
Claudio did not work, I will give more details the value is returned from a datasnap server using the technique of Reflection using JSON the value in the SQL database is a decimal (similar to money). I receive the data in a memtable and do Binding in a listview.
– edmjunio
Sorry for the delay in answering, if it is a decimal try so : Format('%10.2f',[Self.Owner.Fieldbyname('soma'). Asfloat])
– Claudio Ferreira