Fórum Função para truncar valor numérico #534566
15/10/2015
0
Sou novo no firebird e tenho o seguinte problema:
Tenho uma variavel que recebe o valor 12,456. Gostaria de truncar esse valor, ou seja, transforma-lo em 12,45.
No Oracle eu uso a função trunc e funciona legal. No fire qual seria a melhor forma de fazer isso?
Att.
Thyago Brasil
Desenvolvedor Web
Thyago Henrique
Curtir tópico
+ 0Posts
16/10/2015
Thyago Henrique
Gostei + 0
16/10/2015
Alex Lekao
[url]http://www.firebirdsql.org/refdocs/langrefupd25-intfunc-trunc.html[/url]
[url]https://www.devmedia.com.br/forum/funcao-de-arredondamento-no-firebird/55598[/url]
Gostei + 0
16/10/2015
Thyago Henrique
Obrigado
Gostei + 0
16/10/2015
Alex Lekao
Gostei + 0
16/10/2015
Thyago Henrique
Gostei + 0
16/10/2015
Alex Lekao
Gostei + 0
16/10/2015
Thyago Henrique
function ROUND could not be matched.
Gostei + 0
16/10/2015
Alex Lekao
foi essa?
Round(Valor,2)
Gostei + 0
16/10/2015
Thyago Henrique
SELECT Round('2.568', 2) FROM RDB$DATABASE
Preciso que me retorne 2,56
Gostei + 0
16/10/2015
Thyago Henrique
SELECT ROUND(2.568) FROM RDB$DATABASE
Mas assim ele fez pior ainda....arredondou pra 3
Gostei + 0
16/10/2015
Alex Lekao
da uma olhada neste link
[url]https://www.devmedia.com.br/rotinas-de-arredondamento-round-roundto-simpleroundto-setroundmode-e-getroundmode/21114[/url]
pelo artigo deve ter que usar deste tipo.
SimpleRoundTo (-1.235, -2); //retorna - 1.23
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)