Decrease any number to zero in x seconds

Say I want to decrease a number such as 80 to 0 in 5 seconds, that could be hard coded, but what if I wanted to decrease 10,000 to 0 in 5 seconds. My question is what function or code do I need to decrease any number to 0 within x seconds where x is 5 or any number for that matter.

Example if you want to show a value on a Text decreasing over time.

using UnityEngine;
using System.Collections;

public class DecreaseTest : MonoBehaviour
{
    public UnityEngine.UI.Text text ;        
    public float v = 50 ;
    public float duration = 5 ;
    
    private void Start()
    {
        text.text = v.ToString();
        StartCoroutine( Decrease( v, duration, OnValueChanged ) ) ;
    }
    
    private void OnValueChanged( float value )
    {
        text.text = value.ToString() ;
    }
    
    private IEnumerator Decrease( float value, float duration, System.Action<float> onValueChange )
    {
        float delta = 0 ;

        if( value < Mathf.Epsilon || duration < Mathf.Epsilon )
        {
            onValueChange( 0 );
            yield break;
        }

        delta = value / duration ;
        
        for( float t = 0 ; t < duration ; t += Time.deltaTime )
        {
            yield return null ;
            value = value - Time.deltaTime * delta ;
            value = value < 0 ? 0 : value ;
            if( onValueChange != null )
                onValueChange( value ) ;
        }
    }
}

Thanks!!! It worked like a charm