NOT ASSIGNING VARIABLE

here is the code :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;


public class RMP_count : MonoBehaviour {



	// REFORMED UI RMP DATA
	public GameObject Rmp;
	private Text text;
	private string canvas_RMP_to_string;
	private string y;

	// Use this for initialization
	void Start () {

		text = Rmp.GetComponent<Text> ();

	}
	
	// Update is called once per frame
	void Update () {
		float x = float.Parse(text.text);
		y = text.text;
		y = Math.Round((x / 1000) , 1).ToString();
		text.text = y;

		Debug.Log (text.text);
	}
}

I get what i want in Debug.Log (text.text); part and it is perfect but the problem is the part text.text = y; it IS NOT ASSIGNING and in game scene it is not shows up !!!
what can i do?

change this

 text.text

with this

text.GetComponent<Text>().text

Are you sure that your “Rmp” reference actually point to the object in the scene? I suspect that this might reference a different instance, for example a prefab?

Change your Debug.Log to:

Debug.Log (text.text, Rmp);

Now when you click on the debug message in the console, the editor will highlight the referenced object yellow, either in the hierarchy or in the project view. Make sure that the object is the correct instance.

hey man …

Thanx every one for helping

i just solved the problem from source code , i just found that variable from the source and then divided that to 1000 and problem been solved !

thanx every one …

love u