Can I use image.fillAmount to fill a power bar with a float I have fluctuating between 0 and 100?

I am able to get the power bar to fill up at a fixed time using the commented out part of the code, but I would like to have the bar go up and down according to the percentage float. Here is the code:

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PowerMeter : MonoBehaviour
{
    public Transform PowerMeterBar;   
    public bool buttonPressed = false; 
       

    public int sign = 1;

    [SerializeField]
    private float percentage;
    [SerializeField]
    private float currentAmount;
    [SerializeField]
    private float speed = 30;
	
	void Start ()
    {
        
	}

    public void ButtonDown()
    {
        buttonPressed = true;
    }

    public void ButtonUp()
    {
        buttonPressed = false;
    }

    public void Update()
    {
        if (buttonPressed)
        {
            percentage += sign;
            Debug.Log(percentage);

            if (percentage == 100 || percentage == 0)
                sign *= -1;                        
        }

        //if (currentAmount < 100)
        //{
        //    currentAmount += speed * Time.deltaTime;
        //}
        //PowerMeterBar.GetComponent<Image>().fillAmount = currentAmount / 100;

        PowerMeterBar.GetComponent<Image>().fillAmount = percentage / 100;
    }


}

This will work - tested

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class PowerMeter : MonoBehaviour
{
    public Image powerMeterBar;   
    public bool buttonPressed = false; 

    public int sign = 1;

    [SerializeField]
    private float percentage;
    [SerializeField]
    private float currentAmount;
    [SerializeField]
    private float speed = 30;
    
    void Start ()
    {
        if (powerMeterBar != null)
        {
            percentage = powerMeterBar.fillAmount * 100;
        }
    }

    public void ButtonDown()
    {
        buttonPressed = true;
    }

    public void ButtonUp()
    {
        buttonPressed = false;
    }

    public void Update()
    {
        if (buttonPressed)
        {
            percentage += sign;
            Debug.Log(percentage);

            if (percentage >= 100 || percentage <= 0)
            {
                sign *= -1;
                percentage = ((percentage <= 0) ? 0 : 100);
            }
        }
        powerMeterBar.fillAmount = percentage / 100;
    }
}