Manage Display formatting settings won't work

by vocafeuvre   Last Updated January 09, 2018 09:07 AM

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.

Answers 1

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.

January 09, 2018 08:37 AM

Related Questions

How to load field configurations in code

Updated January 26, 2017 14:03 PM

Change existing field definition

Updated January 27, 2017 14:03 PM

Add new existing field for existing content type

Updated June 12, 2017 13:07 PM

Add default image to image file programmatically

Updated August 11, 2017 10:07 AM