Splunk Search

How can I convert integer to decimal?

isac_santana
Explorer

Good Morning,
I'm having trouble converting a whole number to a decimal. 



Example:

 

 

| eval Amount = round(tonumber(balance_amount), 2)
Result: 814118225.00

 

 



But I need the number to look like:  8141182.25

Labels (1)
0 Karma
1 Solution

Manasa_401
Communicator

Hello @isac_santana 

If you want to convert an integer number to decimal, try dividing the number as shown below

| eval Amount = balance_amount/100

If this helps an upvote would be appreciated.

Thanks,

Manasa

View solution in original post

0 Karma

Manasa_401
Communicator

Hello @isac_santana 

If you want to convert an integer number to decimal, try dividing the number as shown below

| eval Amount = balance_amount/100

If this helps an upvote would be appreciated.

Thanks,

Manasa

0 Karma
Get Updates on the Splunk Community!

Enter the Dashboard Challenge and Watch the .conf24 Global Broadcast!

The Splunk Community Dashboard Challenge is still happening, and it's not too late to enter for the week of ...

Join Us at the Builder Bar at .conf24 – Empowering Innovation and Collaboration

What is the Builder Bar? The Builder Bar is more than just a place; it's a hub of creativity, collaboration, ...

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...