# Facing Issue with Custom Attribute Binding

**URL:** <https://discourse.aurelia.io/t/facing-issue-with-custom-attribute-binding/5468>\
**Category:** Uncategorized\
**Created:** [June 24, 2024, 5:03am UTC](https://discourse.aurelia.io/t/facing-issue-with-custom-attribute-binding/5468 "2024-06-24T05:03:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rosa56](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/rosa56/32/2526_2.png) [@rosa56](https://discourse.aurelia.io/u/rosa56)\
**Post date:** [June 24, 2024, 5:03am UTC](https://discourse.aurelia.io/t/facing-issue-with-custom-attribute-binding/5468/1 "2024-06-24T05:03:53Z")

</div>

Hello guys! 🥰

I am new to Aurelia and I am running into an issue with custom attribute binding that I can’t seem to resolve. I’m trying to create a custom attribute that formats a number as currency. Here’s what I have so far:

```auto
import { bindable } from 'aurelia-framework';

export class CurrencyCustomAttribute {
  @bindable value;

  valueChanged(newValue) {
    this.element.innerHTML = newValue.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
  }

  bind() {
    this.valueChanged(this.value);
  }
}

```

And here is how I am using it in my HTML:

```auto
<span currency="amount"></span>

```

The amount is a property in my view-model that holds a numeric value. However, when I run my application, the binding doesn’t seem to work correctly. The span element does not get updated with the formatted currency.

I also check this resource: [https://discourse.aurelia.io/t/custom-attribute-bindable-property-does-not-callcal](https://discourse.aurelia.io/t/custom-attribute-bindable-property-does-not-call-callback/4847)[looker](https://www.igmguru.com/data-science-bi/looker-training/) But I have not found any solution.

Thanks in advance! 😇
