# Code Functions for Formatting Strings
# This module provides functions to format strings in various ways.

def indian_format(x):
    x = str(x)
    if len(x) <= 3:
        return x
    s = x[:-4:-1] + ','
    g = ""
    for i, j in enumerate(x[-4::-1]):
        g += j
        if (i + 1) % 2 == 0 and i != len(x[-4::-1]) - 1:
            g += ','
    s= g[::-1] + s[::-1]
    return s
