Slider Script Unity

using UnityEngine;
using UnityEngine.UI;
using TMPro;

public class SliderScript : MonoBehaviour
{
    [SerializeField] private Slider slider; //attach slider here
    [SerializeField] private TextMeshProUGUI sliderNumber; //attach TextMeshProText here

    private void Start()
    {
        slider.onValueChanged.AddListener((value) =>
        {
            sliderNumber.text = value.ToString("0");
        });
    }
}
AULOX