Check if there is decimal before calling getNanos.