remove currency symbol

0 Answers 166 Views
Input NumericTextBox
Kenji
Top achievements
Rank 1
Iron
Iron
Kenji asked on 07 Feb 2023, 09:33 AM

Hi i want to ask about currency format number like in this demo Link

so i already implement currency format in input kendo ui component but still fail to remove currency symbol
is there any reference from doc? and also where is the list of locales code for currency format?

here is my setup code for currency format

import { provideIntlService } from "@progress/kendo-vue-intl";
<KInput
  type="text"
  v-model="formattedNumber"
  placeholder="Input Salary Amount"
  @blur="saveResumeAI('draft')"
>
</KInput>
computed: {
        formattedNumber: function(){
            return provideIntlService(this).formatNumber(current_salary_value, "c")
        }

    },

"@progress/kendo-vue-intl": "^3.7.1",

Petar
Telerik team
commented on 07 Feb 2023, 10:55 AM

Hi, Kenji.

If you don't want to display a currency symbol in front of a numeric value, then you have to format this value as a number and not as currency.

Here is a StackBlitz example demonstrating how to apply numeric formatting with two symbols after the decimal sign. To achieve the demonstrated implementation, the following code is used:

computed: {
  formattedNumber: function () {
    return provideIntlService(this).formatNumber(133300, 'n2');
  },
}

The code in yellow defines the formatting of the numeric value. Details about the different formatting options you can find on the following links:

If you share more details about the formatting you want to achieve, we can help you with this task.

I hope the above details will help you implement the desired numeric formatting. If you need furhter assistance with the discussed scenario,, we will be happy to help.

Kenji
Top achievements
Rank 1
Iron
Iron
commented on 08 Feb 2023, 06:42 AM

Hi Petar,

thanks for your answer. my poin is that i need 2 currency format. one like this 1.000.000,00 and others like this 1,000,000.00
i already tried your suggestion and works fine but the other format still fail to implement. how to achieve currency format like this 1.000.000,00?
thanks
Kenji
Top achievements
Rank 1
Iron
Iron
commented on 08 Feb 2023, 09:05 AM

and other things i just mention is that i cannot type anything because computed need setter
my code right now

<KInput
                        type="text"
                        v-model="formattedCurrentSalary"
                        placeholder="Input Salary Amount"
                        @blur="saveResumeAI('draft')"
                    >
                   

</KInput>

formattedCurrentSalary: function(){
            if(this.candData.mem_current_salary_currency == 'USD'){
                return provideIntlService(this).formatNumber(this.candData.mem_current_salary_amount, "n2")
            } else{
                let formatOthers = provideIntlService(this).formatNumber(this.candData.mem_current_salary_amount, "n2")
                return formatOthers.replace(/[.,]/g, function(x) {
                    return x == ',' ? '.' : ',';
                });
            }
        }
Petar
Telerik team
commented on 08 Feb 2023, 04:14 PM

Hi, Kenji. 

The recommended way to achieve the functionality of having editable inputs that have different formatting is demonstrated in this StackBlitz example. In this example we have the following definition:

  <intl :locale="'en-US'">
    <CurrencyFormatter />
  </intl>
  <intl :locale="'de-DE'">
    <CurrencyFormatter />
  </intl>
  <intl :locale="'bg-BG'">
    <CurrencyFormatter />
  </intl>

Having the above, inside the CurrencyFormatter component the NumericTextbox will be formatted based on the locale defined for it. 

Please check the above example and let me know if it helps you achieve what you need or if you have questions about the suggested implementation.

Kenji
Top achievements
Rank 1
Iron
Iron
commented on 09 Feb 2023, 02:42 AM

Hi Petar,

it works and thanks a lot for your help

Petar
Telerik team
commented on 09 Feb 2023, 08:22 AM

Hi, Kenji.

You are welcome! I am happy I could help!

No answers yet. Maybe you can help?

Tags
Input NumericTextBox
Asked by
Kenji
Top achievements
Rank 1
Iron
Iron
Share this question
or