cancel
Showing results for 
Search instead for 
Did you mean: 

Number Format

Former Member
0 Kudos

Hi All,

we are developing WebDynpro Application through RFC Adaptive model, everything is working fine except for number format.....

We are getting number format like 122.000,00 from backend.....but i want to display according to country specific.....

if any body done this coding according to country specific please tell me.

Really i appreciate your help.

Thanks and Regards,

Abhi.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182294
Active Contributor
0 Kudos

You can refer my prevois thread

Regards

Abhilash

Former Member
0 Kudos

Hi Abhilash,

Thanks for your immediate reply, i already tried that code.....i am not getting output.....

i am getting number like in this format 122.000,00....now i want to display like this format 122,000.00.....

please tell me how to write this code in webdynpro.

Really i appreciate your work.

Thanks and Regards,

Abhi.

former_member182294
Active Contributor
0 Kudos

Hi Abhi...

What is 122.000,00 is it currency? or some number?

And this format is always like this or it will change based on Locale? Can you lets know which Locale you are using?

Regards

Abhilash

Former Member
0 Kudos

Hi Abhilash,

Yes it's Quantity.....right we are in US.....could u pls tell me how to get According to US based and Europe Based value to displaying that value.

Thanks and Regards,

Abhi.

former_member182294
Active Contributor
0 Kudos

This is little bit tricky. Becuase Java will not understand the format 12.00,00 but which is valid in SAP. I think you should change user settings to represent like 12,00.00.

Then you can use Locale.US or Locale.UK to get the corresponding countries formats with my previous code.

If you do not have option to change SAP user settings then programatically change the format fromt from 12.00,00 to 12,00.00

Regards

Abhilash

Former Member
0 Kudos

Hi Abhilash,

Sorry for late reply.....can you tell me how to write country specific number format code....

i wrote some thing but i failed......if u have contry specific number format code send to me.....

i will be waiting for your code....

really i appreciate.

Thanks and Regards,

Abhi.

former_member182294
Active Contributor
0 Kudos

Hi

try this..

Date sapDate = wdContext.current<nodeName>Element.getMysapdate();

IUser currentUser = WDClientUser.getCurrentUser().getSAPUser();

Locale userLocale = currentUser.getLocale();

NumberFormat nFormat = NumberFormat.getNumberInstance(userLocale);

Number localeNumber = nFormat.parse(wdContext.currentContextElement().getSAPNumber());

Regards

Abhilash

Former Member
0 Kudos

Hi Abhilash,

Thanks for your reply....there is no getSAPNumber methode....so if you don't mind.....do you know country specific code....if u know country specific please tell me....

Really i appreciate.

Thanks and Regards,

Abhi.

former_member182294
Active Contributor
0 Kudos

Hmm......

There is no method called getSAPNumber. I referred it as context attribute.

Replace this with the actual field which holds numeric value in your application.

The code I mentioned above handles countrys specific formatting based on logged in user preferences.

I am not sure what else you need.

Regards

Abhilash

Former Member
0 Kudos

Hi Abhilash,

Sorry for late reply to u.....i solved my problem....