Hi
Where i can find programing doc like for how i do Format(var,"##,##0.00") and other intruction that support IOS
I’m not certain there’s a document like that. It’s also really hard to find information about the namespaced framework in the wiki. You kind of have to already know what you’re looking for, which doesn’t help much.
In the namespaced framework, Format became a function of the number you’re trying to convert.
https://documentation.xojo.com/api/deprecated/deprecated_class_members/double.totext.html
https://documentation.xojo.com/api/deprecated/deprecated_class_members/integer.totext.html
Good luck!
look my code but no works
Var er As Text
Try
Rs=App.DBConn.SQLSelect(SqlStr)
Catch e As iOSSQLiteException
//ErrorLabel.Text = e.Reason
er= e.Reason
End Try
If Rs.RecordCount > 0 Then
Var TotalBalence As Double
try
TxtNumSocio.Text=Rs.Field(“DataSocioNum”).TextValue
TxtNombre.Text=Rs.Field(“DataNombre”).TextValue
TxtDistrito.Text=Rs.Field(“DataLocate”).TextValue
TxtTel.Text=Rs.Field(“DataCellphone”).TextValue
TxteMail.Text=Rs.Field(“DataeMail”).TextValue
TotalBalence=Rs.Field("DataBalance").CurrencyValue <<<<< crash or using DoubleValue same error
Label8.Text="Balance Acc :" + TotalBalence.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")
TxtActiveYesNo.Text="Activo"
TxtBuscar.Text=""
catch e As iOSSQLiteException
er=e.Reason
end try
End If
Rs.Close
error is This field is not representable as an Integer
Var er As Text
Try
Rs=App.DBConn.SQLSelect(SqlStr)
Catch e As iOSSQLiteException
//ErrorLabel.Text = e.Reason
er= e.Reason
End Try
If Rs.RecordCount > 0 Then
try
TxtNumSocio.Text=Rs.Field(“DataSocioNum”).TextValue
TxtNombre.Text=Rs.Field(“DataNombre”).TextValue
TxtDistrito.Text=Rs.Field(“DataLocate”).TextValue
TxtTel.Text=Rs.Field(“DataCellphone”).TextValue
TxteMail.Text=Rs.Field(“DataeMail”).TextValue
//TotalBalence=Rs.Field("DataBalance").DoubleValue.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")
Label8.Text="Balance Acc :" + Rs.Field("DataBalance").DoubleValue.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")
TxtActiveYesNo.Text="Activo"
TxtBuscar.Text=""
catch e As iOSSQLiteException
er=e.Reason
end try
End If
Rs.Close
Is the DataBalance
column defined as an INTEGER
in the database?
nop is double
Okay, according to the SQLite docs, that’s valid https://www.sqlite.org/datatype3.html
Something is going wrong with the type. You would have more information to work with by breaking out the single line doozey into multiple variables.
Where does this sample code break and how? Is it a iOSSQLiteException
?
dim tdDataBalance as Double = Rs.Field("DataBalance").DoubleValue
dim ttxFormatted as Text = tdDataBalance.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")
Label8.Text="Balance Acc :" + ttxFormatted
Hi
I use you code and same error This field is not representable as an Integer
If any sqlite editor to check i am using valentina studio
Which line it erred on is important and will tell you whether you have a database or framework problem.
it crash in this line dim tdDataBalance as Double = Rs.Field(“DataBalance”).DoubleValue
ok
how i convert from text to double so i can use two variable.
Dim Mybalance as text=Rs.Field(“DataBalance”).textvalue
Dim Balance as Duble=Mybalance. ?
then show the data on the screen
Label8.Text=“Balance Acc :” + ttxFormatted
[quote=475276:@Alexis Colon Lugo]it crash in this line dim tdDataBalance as Double = Rs.Field(“DataBalance”).DoubleValue
ok[/quote]
I would think that means the database you’re accessing has the a different data type for that column.
I would ask that you check the documentation I linked above. You can reach the answer in two clicks. Granted, you have to know what they are - but exploring the documentation cannot hurt you at all. If you need step by step guidance, send me an email and we can discuss your needs privately.