interpolate icon indicating copy to clipboard operation
interpolate copied to clipboard

How to pass additional format args?

Open Boscop opened this issue 5 years ago • 0 comments

How can I replace this call:

format!(
	"transform-origin: {:.3}% center; transform: translateX({:.3}%) scaleX({:.3});",
	percent,
	100. - percent,
	self.zoom
)

with a call to interpolate::s? This doesn't work:

s!(
	"transform-origin: {percent:.3}% center; transform: translateX({100. - percent:.3}%) scaleX({self.zoom:.3});"
);

How to pass additional format args such as :.3?

Boscop avatar Jan 21 '20 22:01 Boscop