rounding off / truncate to 1 decimal place ? HOW ?

Advanced automation available in Guardian - Chat with others and share files here.
Post Reply
User avatar
decomez6
Posts: 667
Joined: Mon Oct 07, 2019 5:26 pm

hi all ,
running a comparison between selections and their respective VOLUME %.

the option to round off to 2 decimal places is too volatile ,especially when dealing with volume.
whole umbers are too large to capture the closest true value to the current voulume %.

whats the best way to achieve a one decimal place or a truncation.?


much thanks.
decimal rounding off or truncating.png
You do not have the required permissions to view the files attached to this post.
User avatar
gutuami
Posts: 1858
Joined: Wed Apr 15, 2009 4:06 pm

I would probably multiply it by 10 then cut to the whole number
User avatar
decomez6
Posts: 667
Joined: Mon Oct 07, 2019 5:26 pm

gutuami wrote:
Tue Jun 15, 2021 3:17 pm
I would probably multiply it by 10 then cut to the whole number
thanks
still end up with a whole number ? 1 decimal place 000000 . ? **** , where (?) is greater than 0
User avatar
jimibt
Posts: 3665
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

decomez6 wrote:
Tue Jun 15, 2021 3:30 pm
gutuami wrote:
Tue Jun 15, 2021 3:17 pm
I would probably multiply it by 10 then cut to the whole number
thanks
still end up with a whole number ? 1 decimal place 000000 . ? **** , where (?) is greater than 0
i think the idea would be that 23.14 becomes 231 and 45.52 becomes 455 (after rounding down). you could then do a further divide by 10 to take those numbers back to 23.1 and 45.5. a bit convoluted i know, but it is what it is :D

[edit] - you could of course just leave the factored whole numbers as is and compare on those to save the additional step.
User avatar
decomez6
Posts: 667
Joined: Mon Oct 07, 2019 5:26 pm

jimibt wrote:
Tue Jun 15, 2021 3:41 pm
decomez6 wrote:
Tue Jun 15, 2021 3:30 pm
gutuami wrote:
Tue Jun 15, 2021 3:17 pm
I would probably multiply it by 10 then cut to the whole number
thanks
still end up with a whole number ? 1 decimal place 000000 . ? **** , where (?) is greater than 0
i think the idea would be that 23.14 becomes 231 and 45.52 becomes 455 (after rounding down). you could then do a further divide by 10 to take those numbers back to 23.1 and 45.5. a bit convoluted i know, but it is what it is :D

[edit] - you could of course just leave the factored whole numbers as is and compare on those to save the additional step.
thanks jim
convolution /per excelounce :D
just need to do that 1000 times on my automation rules.
User avatar
jimibt
Posts: 3665
Joined: Mon Nov 30, 2015 6:42 pm
Location: Narnia

decomez6 wrote:
Tue Jun 15, 2021 4:08 pm
jimibt wrote:
Tue Jun 15, 2021 3:41 pm
decomez6 wrote:
Tue Jun 15, 2021 3:30 pm

thanks
still end up with a whole number ? 1 decimal place 000000 . ? **** , where (?) is greater than 0
i think the idea would be that 23.14 becomes 231 and 45.52 becomes 455 (after rounding down). you could then do a further divide by 10 to take those numbers back to 23.1 and 45.5. a bit convoluted i know, but it is what it is :D

[edit] - you could of course just leave the factored whole numbers as is and compare on those to save the additional step.
thanks jim
convolution /per excelounce :D
just need to do that 1000 times on my automation rules.
well, it was mainly gutuami's idea. :) but - depending on your requirement, you could do this as a single 3 step rule and apply it to EVERY selection
User avatar
decomez6
Posts: 667
Joined: Mon Oct 07, 2019 5:26 pm

jimibt wrote:
Tue Jun 15, 2021 4:49 pm
decomez6 wrote:
Tue Jun 15, 2021 4:08 pm
jimibt wrote:
Tue Jun 15, 2021 3:41 pm


i think the idea would be that 23.14 becomes 231 and 45.52 becomes 455 (after rounding down). you could then do a further divide by 10 to take those numbers back to 23.1 and 45.5. a bit convoluted i know, but it is what it is :D

[edit] - you could of course just leave the factored whole numbers as is and compare on those to save the additional step.
thanks jim
convolution /per excelounce :D
just need to do that 1000 times on my automation rules.
well, it was mainly gutuami's idea. :) but - depending on your requirement, you could do this as a single 3 step rule and apply it to EVERY selection
thanks gutuami a mathemagician indeed :D

my requirements are bloated and over the top. sometimes i think i complicate even the most simplest of tasks.
remember what i did with identical prices meet point bot, iam swapping the prices and taking volume as my pivot point . everything rotating around the volume%.
you can take a look at one part of the puzzle on the copy bot below (not firirng ) good luck if you can make it run please let me know:

trying to identify two similar volume% and backing them . the capture range is 1% difference between the selections in question. (0.1% to 0.5% and -0.1% to -0.5%) .NO rounding off
meet point volume% back only -0.5+0.5.baf

next one is almost similar but the first back rule is attached to the stored values , which have been rounded off to the nearest two decimal places . still not firing :lol:
when you find time take a look , OR suggest a better way .





meet point v% back +0.5-0.5 stored values.baf


thanks again gatuami ,
cheers jim
You do not have the required permissions to view the files attached to this post.
User avatar
decomez6
Posts: 667
Joined: Mon Oct 07, 2019 5:26 pm

gutuami wrote:
Tue Jun 15, 2021 3:17 pm
I would probably multiply it by 10 then cut to the whole number
finally got it to work ! :)

find two identical volume %
back /lay
or use as part of other codnditions.
m point vol%-5+5 1 decimal place sv.baf
have some fun '
thank again for your help gutuami.
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Bet Angel - Automation”