Checking if position reached discrete step?

Hi! I am building a snake game but movement needs to be smooth and allowed only when head aligns with grid
for example how to check this position is aligned with discrete step of 1 Vector3(0.54,0,)?

thanks!

ok I managed to work this out, it comes down to round to int and checking if difference is less then some small value
IsThisInteger2 works but IsThisInteger1 doesn’t work

bool IsThisInteger(float myFloat)
    {
        return Mathf.Approximately(myFloat, Mathf.RoundToInt(myFloat));
    }

    bool IsThisInteger2(float myFloat)
    {
        if (Mathf.Abs((myFloat - Mathf.RoundToInt(myFloat))) < 0.01) return true;
        else return false;
    }

    private float number = 0;
    void Update()
    {
        number += Time.deltaTime;
        Debug.Log(number + " " + IsThisInteger2(number));
    }

Since i need to do this on Vector3 is there an more efficient solution?
thanks