Sum of Digits

Calculate the sum of all digits in a number.

Code

General
num.abs.digits.sum

Parameters

Number

Server

More Ruby Snippets