Skip to main content
added 227 characters in body
Source Link
Stewie Griffin
  • 46.9k
  • 16
  • 141
  • 305

Octave, 28 bytes

@(x,y)printf(['%.',y,'f'],x)

Try it online!

Takes the first input as a number and the second as a string. Creates a formatting string: %.yf by concatenation, where y is the input that specifies the number of decimals. x is the input number that will be printed.

Octave, 28 bytes

@(x,y)printf(['%.',y,'f'],x)

Try it online!

Octave, 28 bytes

@(x,y)printf(['%.',y,'f'],x)

Try it online!

Takes the first input as a number and the second as a string. Creates a formatting string: %.yf by concatenation, where y is the input that specifies the number of decimals. x is the input number that will be printed.

Source Link
Stewie Griffin
  • 46.9k
  • 16
  • 141
  • 305

Octave, 28 bytes

@(x,y)printf(['%.',y,'f'],x)

Try it online!