Subject ODP: AW: [firebird-support] Converting with parameters stored in variables?
Author Karol Bieniaszewski

>>Trunc instead of pow?

 

I only mean that you do not need to operate on strings to separate number.

 

A = 123.45 – numeric not a double

A1 = TRUNC(A)

A2 = (A-A1)*POWER(10,3)

 

Then

A1 = 123

A2 = 450

 

SELECT LPAD(TRUNC(X.A), 10, '0') || '.' || LPAD((X.A-TRUNC(X.A))*X.B, 3, '0'), FROM (SELECT 100.12 AS A, POWER(10,3) AS B FROM RDB$DATABASE) X

 

Regards,

Karol Bieniaszewski