It’s possible that grids are using Math.ceil() and auto-layout Math.floor(). Or maybe both are using Math.round and the floating-point math is fluctuating around x.5.
Either way, it would be helpful if you took a look.
It seems like Math.round() is a better solution, but it is not! In some cases it will NOT round correctly. Also, toFixed() will NOT round correctly in some cases.
To correct the rounding problem with the previous Math.round() and toFixed(), you can define a custom JavaScript round function that performs a “nearly equal” test to determine whether a fractional value is sufficiently close to a midpoint value to be subject to midpoint rounding. The following function return the value of the given number rounded to the nearest integer accurately.
If a column grid is set to auto stretch and 0 gutter, the last/right guideline will not show. The first/left line works as expected. But mathmatically, the last/right grid line lands on the pixel just outside the layout, so it’s not drawn.
That omission would make sense for old design apps that limit layout grids to the base artboard. But Figma allows nested frames with their own grid. We should be able to see the far right grid line when nested within a larger frame.