user1167253
user1167253

Reputation: 833

H2. How to format a number

i have the following numbers "12.6" and ".78"

i want to format them, something like this.

"12,60 €" and "0,78 €"

How can i do this with h2 and sql?

thx.

Upvotes: 2

Views: 3748

Answers (2)

user1167253
user1167253

Reputation: 833

TO_CHAR(.78,'999D00') => 0,78

format description

Upvotes: 3

Dmytro
Dmytro

Reputation: 141

if this is decimal variable on Model in ASP.NET - you should to change DisplayFormat:

[DisplayFormat(DataFormatString = "{0:#.##} €", ApplyFormatInEditMode = true)]

Upvotes: 0

Related Questions