cancel
Showing results for 
Search instead for 
Did you mean: 

How to place comma from integer or decimal or any datatype columns of a table

cloud_deep28
Explorer
0 Kudos
1,287

Hello Everyone,

I want to keep comma from a decimal column field of HANA .

For example a decimal field with data like 10200.00. But I want the data to be presented output as 10,200.00.

Could anyone help me to keep comma while displaying output.

currently showing like below:

desired output :

Thanks in advance!

Regards,

Deepthi

Accepted Solutions (0)

Answers (3)

Answers (3)

manju537449
Participant
0 Kudos

Hi Deepthi,

Hope below answer solves your problem.
https://answers.sap.com/answers/12137096/view.html

Regards,

Manjunatha

Jörg_Brandeis
Contributor
0 Kudos

Hi Deepthi,

the presentation of a number is up to the frontend, when you pass over a decimal number.

When you convert it to a character string in the query, you can determine the formatting with the TO_VARCHAR(value[, format]) function.

In your example you should use a query like this:

SELECT TO_VARCHAR(<your Value>, '9,999.00') FROM <Your Table>;      -

This creates a character string with the desired format.

With best regards,
Jörg

neilos
Active Participant
0 Kudos

Hi Deepthi,

Are the numbers being displayed without the thousands separator all the time? Or only when manipulation, like a query?

If the former, I would imagine, as I don't have HANA experience, is controlled 'Admin' > 'System Initilasation' > 'General Settings' > 'Display'

As I mention this is NOT HANA specific, so inaccuracies are expected. But it may point you in the right direction... HTH