Hi,
I am viewing an Excel sheet in my B4J app, and a column contains a price as a decimal number.
The above works, and it will store the values in the map.
However, I am trying to work out how to add numbers together (the Amount value).
I am storing it as a 'String' as I am not sure what I need to use? If I store it as 'Int' then the decimal number will drop.
Anyone know the correct way in storing the 'Amount' value so I can add a value to it later on ?
I am viewing an Excel sheet in my B4J app, and a column contains a price as a decimal number.
B4X:
Type Sales(invoice As String, Account As String, customer As String, Amount As String, CostCode As Int, Date As String)
XL.Initialize
Dim result As XLReaderResult = XL.Reader.ReadSheetByName(File.DirApp, "sales.xlsx", "Invoices")
For Row1Based = 2 To result.BottomRight.Row0Based + 1
Dim s As Sales
s.invoice = result.Get(XL.AddressOne("A", Row1Based))
s.Account = result.Get(XL.AddressOne("B", Row1Based))
s.customer = result.Get(XL.AddressOne("C", Row1Based))
s.Amount = result.Get(XL.AddressOne("F", Row1Based))
s.CostCode = result.Get(XL.AddressOne("M", Row1Based))
s.Date = result.Get(XL.AddressOne("O", Row1Based))
SalesMap.Put(s.invoice,s)
Next
The above works, and it will store the values in the map.
However, I am trying to work out how to add numbers together (the Amount value).
I am storing it as a 'String' as I am not sure what I need to use? If I store it as 'Int' then the decimal number will drop.
Anyone know the correct way in storing the 'Amount' value so I can add a value to it later on ?