<commit_before>function round(value, precision) {
    var multiplier = Math.pow(10, precision || 0);
    return Math.round(value * multiplier) / multiplier;
}

function ConvertDDToDMS(D, lng){
    // this could properly round the seconds, but does not "cascade" the rounding up into minutes...
    //round((0|D*60%1*600)/10,1));    
    
    var dir = D<0?lng?'W':'S':lng?'E':'N';
    var d = Math.floor(Math.abs(D));
    var minFloat = (Math.abs(D) - d) * 60;
    var m = Math.floor(minFloat)
    var s = Math.round((minFloat - m) * 60);
        
    // Handles cascading the value at 60
    if ( s == 60 ) { m++; s = 0 }
    if ( m == 60 ) { d++; m = 0 }

    return {
        dir : dir,
        deg : 0|(d<0?d=-d:d),
        min : 0|m,
        sec : 0|s
    };
}

function DMSString(dmsobj){
    return dmsobj['deg']+'\xB0 '+dmsobj['min']+"' "+dmsobj['sec']+'" '+dmsobj['dir']
}

// works but is not used, much simpler construction is in resource-report.js
function MakeGoogleMapsLink(latdmsobj,longdmsobj){
    var gmaps = 'https://google.com/maps/place/';<commit_msg>Update ConvertDDToDMS seconds<commit_after>function round(value, precision) {
    var multiplier = Math.pow(10, precision || 0);
    return Math.round(value * multiplier) / multiplier;
}

function ConvertDDToDMS(D, lng, precision=1){
    // this could properly round the seconds, but does not "cascade" the rounding up into minutes...
    //round((0|D*60%1*600)/10,1));    
    
    var dir = D<0?lng?'W':'S':lng?'E':'N';
    var d = Math.floor(Math.abs(D));
    var minFloat = (Math.abs(D) - d) * 60;
    var m = Math.floor(minFloat)
    var s = round((minFloat - m) * 60, precision);
    
    // Handles cascading the value at 60
    if ( s == 60 ) { m++; s = 0 }
    if ( m == 60 ) { d++; m = 0 }
    
    return {
        dir : dir,
        deg : (d<0?d=-d:d),
        min : m,
        sec : s
    };
}

function DMSString(dmsobj){
    return dmsobj['deg']+'\xB0 '+dmsobj['min']+"' "+dmsobj['sec']+'" '+dmsobj['dir']
}

// works but is not used, much simpler construction is in resource-report.js
function MakeGoogleMapsLink(latdmsobj,longdmsobj){
    var gmaps = 'https://google.com/maps/place/';
{'fraction_non_alphanumeric': 0.1771744132535665, 'fraction_numerical': 0.02761159687068569, 'mean_word_length': 2.7482758620689656, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '1336278', 'n_tokens_mistral': 841, 'n_tokens_neox': 782, 'n_words': 203}