The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

user macro decimal number

Cocorisu
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2021

Big Thanks to your answer!

TAGS
AUG Leaders

Atlassian Community Events