Since this attribute will not visible on frontend, you can change it's type to any other type.
The solution to this issue is you need to create attribute with type "Price" instead of "Text Field". You cannot change attribute type after creating attribute, so in order to do that follow this instruction
- Delete old attirbute, i.e,
display_order
- Create new one with same attribute code
display_order
- While creating attribute set attribute type
Price
, this will work perfectly with numbers
Hope this will resolve the issue
#EDIT
To hide $
sign from product edit page include custom css file in app/code/Vendor/Module/view/adminhtml/layout/catalog_product_edit.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<script src="Vendor_Module::js/custom_product_edit.js"/>
</head>
</page>
in app/code/Vendor/Module/view/adminhtml/web/js/custom_product_edit.js
you can hide $
sign, like this:
require([
'jquery'
], function ($) {
'use strict';
jQuery(document).ready(function(){
jQuery(document).ajaxStop(function () {
jQuery('input[name=product\\[display_order\\]]').next("label").children("span").hide();
});
});
});