Is there a way to take values created in a glide math column and pull out just the decimal (as in TRUNC function in sheets)?
Failing that, is there any way at all to get values computed in a math column back into the Google sheet?
I need to grab the decimal hanging off of whole number results so that I can use that as a percentage for a progress bar.
Also, is there any way to get the progress bars to have individual colors for both the bar and background, and maybe a percentage complete dialogue like the circle and arc progress indicators?
Create a math column that takes the calculated value with the decimal and rounds it to a whole number.
Create a template column that takes the math column and ālocks inā the rounded value
Create a math column that subtracts the original value from the template column value.
Unless I misunderstood. Do you just want the value rounded to a whole number? You can do that in data editor by clicking on the column and setting the precision (rounding).
You canāt alter the color scheme of a progress bar. It is set to match the color scheme of the app. Unless you are willing to mess with the CSS formatting, which in my opinion, is unreliable and can easily break.
For a percentage complete dialog, you can simply create a template column with the text you want.
I donāt need a rounded number. Thatās the problem. I need to round down (so I can use subtraction) or get the REMAINDER as a decimel after you remove the whole number. Examples:
12.7 -12.0 = 0.7
5.2 -5.0 = 0.2
The āprecisionā setting in a number column seems to round off, not down.
Hmmm, Iāll have to think about that. Iām pretty sure thatās not currently possible in glide, but Iām trying to think of a magic math formula in combination with existing glide functions that could do it somehow. If I think of something, Iāll let you know.
That looks like it will work. Itās a brilliant solution. Iāll test it tomorrow.
I mean, itās a kludge to have to workaround like this for something so simple, but this is more elegant than what my brain was capable of tonight after 6+ hours of glide building.
Yes I agree, it would be nice to have this support natively, I have had to use so many columns for workarounds related to math. At least itās nice to keep it inside Glide.
Or maybe for a couple less columns: a math column that is (original number - 0.5) to zero decimal places, a template column to lock it in, and then (locked in value - original value.
Edit: changed 0.499, which is technically incorrect, to 0.5
Nice work @ThinhDinh . I knew there had to be a roundabout way. I had to do something similar awhile back, but a different scenario. In my case 2 values were joined together to form a number with a decimal, but later needed to split it apart without rounding as well. The whole number is miles and the decimal is āchainsā, where 80 chains is equal to 1 mile. I had converted the 80 chains to 10 based decimal so we could sum total chains and let it also increment the miles. Then later separate the whole number (miles) and decimal (chains) so I could convert the decimal form of chains back into itās own whole number form by multiplying it by 80.
Looks to be very similar, but in my case I think I rounded the original value, then created a second value of the rounded number - 1. Then I subtracted the rounded value from the original number. If negative (due to rounding up), then I used the column with the number -1. If positive, then I used the original rounded column since it rounded down. That gave me the final whole number value and I subtracted that from the original value to get the chains decimal value by itself.
This works great unless the current value is 0, which returns problematic results. Unfortunately, the starting value for this function will be 0 unless students are choosing to donate funds into a particular asset.