Topic: How To Set Format Value in tablegrid
How to edit script set format in tablegrid
-number
123456.789 to
123,456.789
-date
2016-09-14 14:39 to
14/09/2020
by year + 4
-time
14:39 to
02:39 AM
Easy For Beginner Student For Me
My Visual Database → General → How To Set Format Value in tablegrid
How to edit script set format in tablegrid
-number
123456.789 to
123,456.789
-date
2016-09-14 14:39 to
14/09/2020
by year + 4
-time
14:39 to
02:39 AM
How to edit script set format in tablegrid
-number
123456.789 to123,456.789
You should use type CURRENCY for field, where you can activate thousand separator:
-date
2016-09-14 14:39 to14/09/2020 by year + 4
You should use calculate field, an example:
strftime('%d.%m.%Y', datefield, '+4 years')
-time
14:39 to02:39 AM
My Visual Database uses user's regional format, but if you need, you can change format in the tablegrid using script, an example:
procedure Form1_GridEmployees_OnChange (Sender: string);
var
i,c: integer;
sTime: string;
begin
Form1.GridEmployees.BeginUpdate;
c := Form1.GridEmployees.RowCount - 1;
for i := 0 to c do
begin
sTime := Form1.GridEmployees.Cells[4,i];
if sTime<>'' then
Form1.GridEmployees.Cells[4,i] := FormatDateTime( 'hh:mm ampm', StrToTime(sTime) );
end;
Form1.GridEmployees.EndUpdate;
end;
I'm with MVD version 4.6. My table has a "Currency" field with 2 decimal places and a thousand separations. I recorded in this field the value of 243.35, but in the tablegrid it appears only 243.00.
In the sqlite table and in the textbox the value is 243.35, but not in the tablegrid.
Can anyone help? Is this a bug?
Hello JRGA,
It sounds as if, in the edit field on the form where you are entering your value, you have ticked the 'currency' object property. If so, then make sure that you also set the 'accuracy' object property to '2'. If you set the one without setting the other, the value will only show whole numbers.
Alternatively, leave both of these two object properties as their defaults ('unticked' and 0') and allow the program to use the original definitions that you specified when defining your table.
Hope this is clear and helps,
Derek.
I'm with MVD version 4.6. My table has a "Currency" field with 2 decimal places and a thousand separations. I recorded in this field the value of 243.35, but in the tablegrid it appears only 243.00.
In the sqlite table and in the textbox the value is 243.35, but not in the tablegrid.
Can anyone help? Is this a bug?
Please attach your project, I'll test it.
My Visual Database → General → How To Set Format Value in tablegrid
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi