Skip to main content
sorry not native english
Source Link
marcosm
  • 1.1k
  • 5
  • 10

#BASH, 26 23 21 bytes

bc<<<"scale=$2;$1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

edit:no need to load library

#BASH, 26 23 21 bytes

bc<<<"scale=$2;$1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

edit:no need to load library

#BASH, 26 23 21 bytes

bc<<<"scale=$2;$1/1"

##usage save to round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

edit:no need to load library

one space to beat perl...
Source Link
marcosm
  • 1.1k
  • 5
  • 10

#bash#BASH, 2626 23 21 bytes

bc -l <<<"scale=$2; $1bc<<<"scale=$2;$1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

edit:no need to load library

#bash, 26 bytes

bc -l <<<"scale=$2; $1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

#BASH, 26 23 21 bytes

bc<<<"scale=$2;$1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3

edit:no need to load library

Source Link
marcosm
  • 1.1k
  • 5
  • 10

#bash, 26 bytes

bc -l <<<"scale=$2; $1/1"

##usage save to a round_string.sh, chmod +x round_string.sh

./round_string.sh 23456789.987654321 3