cancel
Showing results for 
Search instead for 
Did you mean: 

Offline values

MariusStoica
Active Participant
0 Kudos

Hi guys,

For a few weeks now I've been meddling with the offline store and it's capabilities thanks to "".

I've succeeded opening, refreshing, closing the store. Now that I've read the data and saved it to the store, I'm trying to use it.

I have an issue with it.

Ex: As you can see on the right side, the values is correct 1323,39 / 2500,00 RON (credit usage, and credit limit) when I read them directly from the back-end.

But when I read them from the offline store, the value changes. I have 2.5e+3 instead of 2500.00 RON.

While debugging the request to and from the back-end system, I haven't seen a change in the value.

The view it's XMLView and the value is written like this:


number="{Clients>CreditUsage} / {Clients>CreditLimit}"

so no formats.

Do you guys have a clue why this happens ?

Thank you in advance,

Marius

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Kudos

Hi,

I remember I faced this issue long back while developing app on android. As a workaround I used type casting of values before showing it in screen. You could try it like .toString();

Regards,Midhun

SAP Technology RIG

MariusStoica
Active Participant
0 Kudos

Hi Midhun,

"long back" ?

I used a formatter and now the value looks similar to the one done from back-end.


CreditUsage = parseFloat(CreditUsage);

CreditLimit = parseFloat(CreditLimit);

return ( oNumberFormatD2.format(CreditUsage) + " / " + oNumberFormatD2.format(CreditLimit) );

where  "oNumberFormatD2" is :


jQuery.sap.require("sap.ui.core.format.NumberFormat");

oNumberFormatD2 = sap.ui.core.format.NumberFormat.getIntegerInstance({ 

  maxFractionDigits: 2, 

  minFractionDigits: 2, 

  groupingEnabled: false });

What i'm afraid of is loosing value. For example: 1234567,89 RON to be ransformed in 1,2e+6 ... and when I format it back I get 1200000.00 RON. I'll have to check it out.

Basically is something like you described.

Thanks,

Marius

midhun_vp
Active Contributor
0 Kudos

Hi Marius,

Yes it was few years back when I was working on SUP. The local DB was the same ultralite DB.

Regards,Midhun

SAP Technology RIG

Answers (0)