Your idea is essentially correct. We can formalize it with the floor and fractional part functions:
$\newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\fp}[1]{\left\{ #1 \right\}}
\floor{x}$ is the largest integer $\le x$, i.e. $\floor{x} := \max \{ k \in \mathbb{Z} \mid k \le x \}$
$\fp{x}$ is the fractional part, defined by $\fp{x} := x - \floor{x}$
Here, then, you want $y = \fp{x}$.
Correspondingly, $y \in [0,1)$ and $x - y = x - \fp{x} = x - (x-\floor{x})= \floor{x} \in \mathbb{Z}$.
If you don't want to appeal to alternative functions, do so with decimal expansions. Write
$$x := u\sum_{i \in \mathbb{Z}} d_i 10^i = \pm \cdots d_3d_2d_1d_0 . d_{-1}d_{-2}d_{-3} \cdots$$
where $d_i = 0$ for all sufficiently large $i$, and $d_i \in \{0,1,2,\cdots,9\}$ generally. Finally, $u \in \{+1,-1\}$, in order to account for the sign of $x$.
Then the $y$ you want is
$$y := \begin{cases}
\displaystyle \sum_{i = -\infty}^{-1} d_i 10^i = 0.d_{-1}d_{-2}d_{-3} \cdots & x \ge 0 \\
1 - \displaystyle \sum_{i = -\infty}^{-1} d_i 10^i & x < 0
\end{cases}
$$
Uniqueness in either framework I leave up to you, but it's fairly straightforward.