on 07-31-2014 8:08 AM
Hi All,
I have set of 14 text fields, also i have a text view which displays the sum of values entered in 14 text fields.I am able to sum the values entered in the fields, but i need it to be displayed in this format "11,22,33,444". For now i am able to display in this format"112,233,444" How can this be done ?
Thanks and regards,
Ravikiran
Hi Ravi,
You can use the formatter for this purpose.
Please fin the below code already posted by Robin van het hof .
Regards,
Madhumahesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
1) Please explain what you have tried?
2) Did you try changing the currency format to INR?
3) Did you go through this thread Completely -> Check this out
Regards,
Madhumahesh.
Hi Madhumahesh,
I tried the same, I followed same approach.
Yes, i changed the currency to INR, but again the coma appears evenly after every 3 digits.
How can i limit the coma first to 3 digits and then move with 2 digits ?
There is option for indian currency to displayed in all regional languges which is in the format i wanted.
Thanks,
Ravikiran
Hi Ravi,
as mentioned earlier the document posted by sreehari (link) is working fine.
Unable to understand why you not able to achieve it.
Can you please post your code, so that it will be helpful to solve your query.
See the sample output below
Regards,
Madhumahesh.
Using my version of Chrome (v36 on OS X), setting locale to en-IN and currency to INR I only got it to display
Rs123.456.789,00
format (so not the Indian separator system) and on IE11 on Win7 it displayed
₹123.456.789,00
However, setting the locale to hi-IN resulted in
रु. १२,३४,५६,७८९
on Chrome and
₹ 12,34,56,789.00
on IE11 so depending on your browser, you may see what works best for you
Hi Madhumahesh ,
Please find the code below,
View:
var oVENUE_BUDGET_TF = new sap.ui.commons.TextField(
'EV_EC_VENUE_BUDGET', {
width : "200px",
value : "{EventModel>/VENUEBUDGETF}"
}).addStyleClass('style0');
oVENUE_BUDGET_TF.setValue(oNumberFormat.format()); // Set the formatted
// value on the text
// field
oVENUE_BUDGET_TF.attachChange(function() {
var Val = sap.ui.getCore().byId('EV_EC_VENUE_BUDGET').getValue();
var Field = sap.ui.getCore().byId('EV_EC_VENUE_BUDGET');
helpers.prototype.ValidateInteger(Val, Field);
oController.textFieldNumberFormat1(Field);
});
Controller:
textFieldNumberFormat1 : function(Field) {
var value = Field.getValue();
var floatValue = parseFloat(value);
var formatter = new Intl.NumberFormat('en-US');// , {
// style : "currency",
// currency : "INR"});
Field.setValue(formatter.format(floatValue));
console.log(Field);
},
Thanks,
Ravikiran
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.