Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

user macro decimal number

Cocorisu November 30, 2021

Hey Everyone,

I want to edit a user macro in confluence server. The result is a number which is at the moment shown as e.g.: 0.01683053094893694
Is there anyone who can tell me, how i get this number shortened to 0.01? (2 decimals )

1 answer

1 accepted

1 vote
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2021

Hi @Cocorisu 

Do you need to calculate with this value?

Unfortunately, the mathtool of velocity isn't integrated in confluence server. So here is a hack solution with strings.

#set ($number = 0.0012346815154)
$number
<br>
$number.toString().substring(0,4)

Regards, Dominic

Cocorisu November 30, 2021

Big Thanks to your answer!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events