0

I've got a problem with formatting decimal fields in Drupal using the Manage Display settings. I've already specified a thousands separator for this particular decimal field:

enter image description here

And clicked Update and Save: (see that it displays a sample value already formatted)

enter image description here

However, when I go to the actual field, it doesn't have any formatting:

enter image description here

Already tried formatting this field using a combination of a jQuery plugin and #attributes in this field's array, but Drupal won't save the value since it only accepts the dot and numbers as valid decimal value.

Is there anything I'm missing here? I should also say that I'm using a custom theme. I'm also willing to give info about my code as long as it doesn't touch sensitive business logic.

0

Manage Display is for the front end, not the back end (i.e. not the entity edit form).

When the field value renders on the front end, you'll see the formatting you've chosen.

There's probably not much point trying to force formatting for a number in the backend, it makes more sense to take the raw number and then only manipulate it upon output. But if you absolutely need the functionality, it'll likely be a custom JS job as Drupal doesn't have anything built in to handle it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.