<span id="result_box" class="long_text"><span style="background-color: rgb(255, 255, 255);" title="Olá a todos,">Hello everyone,<br><br></span><span style="background-color: rgb(255, 255, 255);" title="Eu gostaria de comparar todos o valores de uma lista com um valor de input e então decidir qual é o valor mais próximo e substituir esse valor mais próximo pelo valor de input.">I
would like to compare all the values in a list with a value of input
and then decide which is the closest value and replace that value
closer to the amount of input.<br><br></span><span style="background-color: rgb(255, 255, 255);" title="Por exemplo, eu tenho uma lista &lt;2, 10, 35&gt; e tenho um valor de input de &lt;12&gt; , gostaria que o output fosse uma lista &lt;2, 12, 35&gt;.">For
example, I have a list &lt;2, 10, 35&gt; and have an input value of
&lt;12&gt; I would like the list as output &lt;2, 12, 35&gt;. </span><span style="background-color: rgb(255, 255, 255);" title="Eu estou quase conseguindo, mas o patch está tão feio que nem vou mostrar aqui, tenho certeza que existe uma solução mais elegante.">I&#39;m almost getting, but the patch is so ugly that I will not show here, i&#39;m sure there is a more elegant solution. </span><span title="Alguém tem uma idéia?">Does anyone have an idea?<br>
</span><span style="background-color: rgb(255, 255, 255);" title="Abraços">tnx ;)<br></span></span>