You can use a calculated column to achieve this. Create a calculated column and set return type as number. Then, simply change the calculated column formula from C#.
Update
A similar way to do this would be using JSLink. You can include the below script in a JS file and place it in your VS solution (typically in your _layouts mapped folder). You wouldn't be able to dynamically change the HTML string though.
(function () { // Using the fields override leaves the rest of the rendering intact but allows control over one or more fields in the view var overrideCtx = {}; overrideCtx.Templates = {}; // Add OnPostRender event handler to hide the column if empty overrideCtx.Templates.Fields = { 'Body':{'View':EmbedHTML} }; //Register the template override SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx); })(); function EmbedHTML(){ var retVal = ctx.CurrentItem.Body; //to retrieve the field var HTMLAppendedString; if(ctx.CurrentItem.ID == ID) //id of item to change { HTMLAppendedString = "<b>"+retVal+"</b>"; //Custom HTML goes here. } else { HTMLAppendedString = retVal; } return HTMLAppendedString; } You can call this using spfield.JSLink="location_of_JS_file"
spfield.Update();
Hope this helps you.