Question

FreedomUI - Format number in list view without commas

Hello,

In the freedom UI section list view, is there a way to format a numeric field so that it shows without commas? The field is an integer field and meant to store an identification number and not a quantity, so we are looking for a way to apply a custom format for the column to just show the digits without commas.

We did try to use a text field, but it doesn't work well because the sorting and filtering treats it as text values.

In classic UI it seemed like there were ways to do this like the post below. Is there something equivalent for FreedomUI?

 

https://community.creatio.com/questions/change-display-format-section-l…

Like 1

Like

4 comments

Hello,

 

The only possible working way to achieve this was using this code in the section list handlers:

{
				request: "crt.LoadDataRequest",
				handler: async (request, next) => {
					var allElements = document.getElementsByTagName("td");
					for (var i = 0; i < allElements.length; i++) {
						if (allElements[i].className.indexOf("PDS_UsrIntegCol") != -1) {
							var valueToReplaceElement = allElements[i].getElementsByClassName("crt-data-table-cell-value ng-star-inserted")[0];
							var valueToReplaceValue = valueToReplaceElement.innerText;
							valueToReplaceElement.innerText = valueToReplaceValue.replace(",", "");
						}
					}
					return next?.handle(request);
				}
			}

you need to replace PDS_UsrIntegCol with PDS_your column code in the code to test. But - it works only on the initial section list load and also sometimes not triggered upon changing the sorting. If someone has a better approach on this topic please share your ideas.

Oleg Drobina,


Is this still the case in Freedom UI? The ability to specify that it should be displayed without thousands separators was available in Classic UI.


It would be very useful if we could specify some of these default formatting options on the entity as well - year fields will always want to be an integer but also want to prevent thousands separators for example, and having to modify every page schema that may display them is not great.

Harvey Adcock, 

A thousand separators depend only on the culture. There is no additional setting that can control it.

We've registered the suggestion to our R&D team to manage the separators from the User's side.  

Harvey Adcock,

Additionally, there are four options of the "Your profile" for number format:

Number format

It's possible to remove the separators by manually adding such an option to the "Number format" object.

Show all comments