Round the coordinates of a model that outputs to a text file? Alright I have this:

import bpy
import decimal

blenderCipher=open('C:\\Users\\Nathan\\Desktop\\t.txt','w')

selected_objects = sorted(bpy.context.selected_objects, key=lambda obj: 
obj.name) #Sort objects 

for obj in selected_objects:

    xloc= obj.location.x #X coordinates of object

    round(xloc,2) #Round X coordinate to 2

    blenderCipher.write(str(xloc)) #write coordinates to text
blenderCipher.close


Although it still doesn't output rounded.
Round just returns a rounded version of your variable, it doesn't change the variable. Your code should read something like:

xloc = round(obj.location.x, 2)