Similarly to match 2019 write / 2019 / and it is a numberliteral match. This thread is locked. If two parameters are given, number will be formatted with decimals decimals with a dot (".") All rights reserved. General Algorithm for sum of digits in a given number: Get the number; Declare a variable to store the sum and set it to 0; Repeat the next two steps till the number is not 0; Get the rightmost digit of the number with help of remainder ‘%’ operator by dividing it with 10 and add it to sum. When Bitwise or is used there is no necessity of type-conversion and … The slice() method is used to extract the last 2 digits of the resulting number. Please mail your requirement at hr@javatpoint.com. Developed by JavaTpoint.