<commit_before>import Leaf

/// A custom leaf tag to format a number to a fixed amount of decimals
/// REGISTER TAG: 
///   tags.use(NumberFormatTag(), as: "numberformat")
///
/// USAGE: 
///   #numberformat(100.3333333333, "2")
///   = 100.33
///
/// - Parameters:
///   - number: Double
///   - decimals: Int (default: 2 decimals)
public final class NumberFormatTag: TagRenderer {
    public func render(tag: TagContext) throws -> Future<TemplateData> {

        guard let number = tag.parameters[safe: 0]?.double else {
            throw tag.error(reason: "Expected a number")
        }<commit_msg>Add public init for NumberFormatTag<commit_after>import Leaf

/// A custom leaf tag to format a number to a fixed amount of decimals
/// REGISTER TAG: 
///   tags.use(NumberFormatTag(), as: "numberformat")
///
/// USAGE: 
///   #numberformat(100.3333333333, "2")
///   = 100.33
///
/// - Parameters:
///   - number: Double
///   - decimals: Int (default: 2 decimals)
public final class NumberFormatTag: TagRenderer {
    public init() {}

    public func render(tag: TagContext) throws -> Future<TemplateData> {

        guard let number = tag.parameters[safe: 0]?.double else {
            throw tag.error(reason: "Expected a number")
        }
{'fraction_non_alphanumeric': 0.1476725521669342, 'fraction_numerical': 0.033707865168539325, 'mean_word_length': 2.656891495601173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6975963', 'n_tokens_mistral': 410, 'n_tokens_neox': 365, 'n_words': 116}