Question: I try to create a program that can evaluate simple math expression like "4+4". The expression is given from the user. 

The program saves it in a `char*` and then searches for binary operation (+,-,\*,:) and does the operation. 

The problem is that I can't figure out how to convert the **single** `char` into a `double` value. 

I know there is the `atof` function but I want to convert single `char`.

There is a way to do that without creating a `char*`?

Answer: 
I found a solution my own with several research, trial and error its working fine for me in angular9. following are the steps I followed

1 : Install & import ngx-tinymce refer <https://www.npmjs.com/package/ngx-tinymce>.  

2 : Following is the html snipet where [config]="textEditorConfig" you will point to the configurations of tinymce editor.

```html
<div class="col-sm-12 col-md-12 col-lg-12">
    <label class="label modal-label text-uppercase">Texts</label>
        <tinymce
          *ngIf="viewMode?.key !== 'view'"
          #reportEditor
          formControlName="expectation"
          [config]="textEditorConfig"
        ></tinymce>
        <!--  View Mode -->
        <div class="template-view"
            *ngIf="viewMode?.key == 'view'"
             [innerHtml]="activityDetailForm?.value?.expectation">
         </div> 
 </div>

```

3 : Define tinymce configuration as follows

```
public static htmlEditorConfig =  {
    height: 350,
    theme: 'modern',
    plugins: 'preview fullpage searchreplace directionality visualchars fullscreen  hr pagebreak nonbreaking anchor advlist lists textcolor wordcount contextmenu colorpicker textpattern link image media paste contextmenu',
    toolbar: 'formatselect | bold italic strikethrough forecolor backcolor | link autolink openlink unlink | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent | image media',
    contextmenu: 'paste link image',
    image_advtab: false,
    image_uploadtab: true,
    a11y_advanced_options: true,
    content_css: [
      '//fonts.googleapis.com/css?family=Raleway&display=swap',
      '//www.tinymce.com/css/codepen.min.css'
    ],

    file_picker_types: 'image',
    file_picker_callback: function (cb) {
    var input = document.createElement('input');
    input.setAttribute('type', 'file');
    input.setAttribute('accept', 'image/*');
    input.onchange = function (e?: HTMLInputEvent) {
      var file = e.target.files[0];

      var reader = new FileReader();
      reader.onload = function (event) {
        console.log("tinymce",event)
        var blobCache =  event.target.result;
        var blobInfo = blobCache;
        cb(blobInfo, { title: file.name });
      };
      reader.readAsDataURL(file);
    };

    input.click();
    interface HTMLInputEvent extends Event {
      target: HTMLInputElement & EventTarget;
    }
  },
  };

```
first create input element of type file and execute function click() to open dialog file selector, follow step is upload selected image (in my case I use [ng-file-upload](https://github.com/danialfarid/ng-file-upload)) and retrieve the public url, remember use promises for wait user action, last step is set url in field of tinymce this is posible with field\_name document.getElementById(field\_name).value

```
$scope.tinymceOptions = {
    selector: "textarea",
    plugins: 'image',
    file_browser_callback: function (field_name, url, type, win) {               
        let input = document.createElement('input');
        input.setAttribute('type', 'file');
        input.setAttribute('accept', 'image/*');            
        input.click();
        input.addEventListener('change', (event) => {
            let defered = $q.defer();
            Upload.upload({
                url: MultimediaService.uploadDocument(),
                data: {
                    file: event.path[0].files[0]
                }
            }).then(function (resp) {
                defered.resolve(resp);                        
            }, function (err) {
                defered.reject(err);
            });
            defered.promise.then(function (resp) {
                document.getElementById(field_name).value = resp['data']['url'];
                return resp['data']['url'];
            }, function (err) {
                return null;
            });
        });
    },
    paste_as_text: true
};

```